Loads all components for the given type

@param ComponentType $type

@return Component[] indexed by component key
359853
public function loadComponents (ComponentType $type) : array
    {
        $path = "{$this->templatesDir}/{$type->getDirectory()}";

        if (!is_dir($path) || !is_readable($path))
        {
            return [];
        }

        $finder = new Finder();
        $files = $finder
            ->files()
            ->in($path)
            ->depth("== 0")
            ->name("*.html.twig")
            ->sortByName();

        $result = [];

        foreach ($files as $file)
        {
            $component = new Component($file, $this->templatePrefix, $type);
            $result[$component->getKey()] = $component;
        }

        return $result;
    }
968314
public function gatherElementsFromType( $type )
	{
		if ( is_string( $type ) )
		{
			$type = $this->getType( $type );
		}

		if ( ! is_array( $type ) ) return false;

		$elements = array();

		foreach ( array( 'elements', 'sequence', 'choice', 'group' ) as $typeComponent )
		{
			if ( ! isset( $type[ $typeComponent ] ) )
			{
				continue;
			}

			foreach ( $type[ $typeComponent ] as $id => $element )
			{
				if ( $id == 'restrictionType')
				{
					continue;
				}

				if ( $id == 'elements' )
				{
					$elements += $element;
					continue;
				}

				$result = $this->gatherElementsFromType( $element );
				if ( ! $result )
				{
					$elements[ "{$element['prefix']}:{$element['name']}" ] = $element;
				}

				$elements += $result;
			}

		}

		return $elements;
	}
1121556
public function getComponents($component = null)
    {
        if (is_null($component)) {
            return $this->components;
        }

        $this->validateComponentExists($component);

        return $this->components[$component];
    }
395415
public function columnsByType(int $type) : array
    {
        $n = $this->numColumns();

        $columns = [];

        for ($i = 0; $i < $n; $i++) {
            if ($this->columnType($i) === $type) {
                $columns[$i] = $this->column($i);
            }
        }

        return $columns;
    }
42610
public function getFieldsByType($key, $type)
    {
        $storage = $this->storageRepository->load();
        if (empty($storage[$type]) || empty($storage[$type]['tca'])) {
            return [];
        }

        $fields = [];
        foreach ($storage[$type]['tca'] as $field => $config) {
            if ($config['config']['type'] !== strtolower($key)) {
                continue;
            }

            $elements = $this->getElementsWhichUseField($field, $type);
            if (empty($elements)) {
                continue;
            }

            $fields[] = [
                'field' => $field,
                'label' => $this->getLabel($elements[0]['key'], $field, $type),
            ];
        }

        return $fields;
    }
469858
public function getAllComponents()
    {
        // Answer Cached Components (if available):
        
        if ($this->cacheAllComponents) {
            return $this->cacheAllComponents;
        }
        
        // Obtain Component Objects:
        
        $components = ArrayList::create();
        
        foreach ($this->getAllChildren() as $child) {
            $components->push($child);
            $components->merge($child->getAllComponents());
        }
        
        $this->cacheAllComponents = $components;
        
        // Answer Component Objects:
        
        return $this->cacheAllComponents;
    }
1029563
protected function getSuggestedTypes($type)
    {
        $mapping = [
            'void'    => false,
            'mixed'   => false,
            'null'    => false,
            'int'     => 'int',
            'integer' => 'int',
            'string'  => 'string',
            'float'   => 'float',
            'bool'    => 'bool',
            'boolean' => 'bool',
        ];

        $typeNames = explode('|', $type);
        return array_unique(
            array_map(
                function ($typeName) use ($mapping) {
                    if (isset($mapping[$typeName])) {
                        return $mapping[$typeName];
                    }

                    if ($this->isTypeArray($typeName)) {
                        return 'array';
                    }

                    if ($this->isTypeCallable($typeName)) {
                        return 'callable';
                    }

                    if ($this->isTypeObject($typeName)) {
                        return $typeName;
                    }

                    return false;
                },
                $typeNames
            )
        );
    }
963361
public static function getCache($type = '') {
        static $caches = [];

        if (!$type) {
            $loader = new ConfigurationLoader();
            $cfg    = $loader->loadConfig('cache');
            $type   = $cfg->get('default', CACHE_TYPE_REDIS);
        }
        if (!isset($caches[ $type ])) {
            if (!isset($cfg)) {
                $loader = new ConfigurationLoader();
                $cfg    = $loader->loadConfig('cache');
            }
            if (!$cfg->getb('enabled')) {
                return new Cache();
            }
            $cache = apply_filter('get_' . $type . '_cache', null, $cfg);
            if (!$cache instanceof Cache) {
                $cache = new Cache ();
            }
            $caches[ $type ] = $cache;
        }

        return $caches[ $type ];
    }
614613
private function resolveTypes($type)
    {
        $batchTypes = [];

        do {
            $batchTypes[] = $batchType = $this->batchRegistry[$type];
        } while (($type = $batchType->getParent()) !== null);

        return $batchTypes;
    }
1087883
public function loadComponents()
    {
        foreach(Config::get('@' . $this->moduleName . '.components', []) as $componentName => $namespace)
        {
            Helper::getMain($namespace, $componentName);
        }
    }
288394
public function findElementtypeByType($type)
    {
        $elementtypes = [];
        foreach ($this->elementtypeManager->findAll() as $elementtype) {
            if ($elementtype->getType() === $type) {
                $elementtypes[] = $elementtype;
            }
        }

        return $elementtypes;
    }
304677
private function resolveTypes($type)
    {
        $sortTypes = [];

        do {
            $sortTypes[] = $sortType = $this->sortRegistry[$type];
        } while (($type = $sortType->getParent()) !== null);

        return $sortTypes;
    }
985243
public function listExtensions($type)
    {
        $results = [];

        if ($this->items === null) {
            $this->loadExtensions();
        }

        if (isset($this->items[$type]) && is_array($this->items[$type])) {
            $results = $this->items[$type];
        }

        if ($this->transactionItems !== null && isset($this->transactionItems[$type])) {
            $results = array_merge($results, $this->transactionItems[$type]);
        }

        return $results;
    }
436373
public function findComponent (string $type, string $key)
    {
        $componentType = $this->typeRegistry->getType($type);

        return $componentType->getComponent($key);
    }
716246
public function load($resource, $type = null)
    {
        $configs = Yaml::parse($resource);

        return $this->createSchemas($configs);
    }
1295014
public function getModifiersByType($type)
    {
        $modifiers = [];

        foreach ($this->modifiers as $modifier) {
            if ($modifier->getType() === $type) {
                $modifiers[$modifier->getIdentifier()->getFull()] = $modifier;
            }
        }

        return $modifiers;
    }
193782
public function load($resource, $type = null): array
    {
        try {
            $path = $this->locator->locate($resource);
            $file = $this->filesystem->openFile($path);
            $configValues = $this->yamlParser->parse($file->getContents());

            return $configValues;
        } catch (FileLocatorFileNotFoundException $error) {
            return [];
        }
    }