Returns enabled resource types by their names.

@param array $names

@return ResourceType[]
514847
public function findEnabledResourceTypesByNames(array $names)
    {
        if (count($names) > 0) {
            $dql = '
                SELECT r
                FROM Claroline\CoreBundle\Entity\Resource\ResourceType r
                WHERE r.isEnabled = true
                AND r.name IN (:names)
            ';

            $query = $this->_em->createQuery($dql);
            $query->setParameter('names', $names);
            $result = $query->getResult();
        } else {
            $result = [];
        }

        return $result;
    }
9484
static protected function createResources($definitions) {
		$resources = [];
		
		foreach ($definitions as $name => $options) {
			if (! isset($options['type'])) {
				throw new InvalidOptions('Type of resource must be specified');
			}
			
			$class = self::NAMESPACE_RESOURCE . '\\' . ucfirst($options['type']);
			unset($options['type']);
			
			$resources[$name] = new $class($options);
		}
		
		return $resources;
	}
319513
public function get($name)
	{
		$namespaced = $this->namespace.':'.$name;

		$queued   = $this->length($namespaced, 'list');
		$delayed  = $this->length($namespaced.':delayed', 'zset');
		$reserved = $this->length($namespaced.':reserved', 'zset');

		return array('queued' => $queued, 'delayed' => $delayed, 'reserved' => $reserved);
	}
78584
static public function getPresets($name = self::FULL)
    {
        if ($presets = ArrayHelper::getValue(self::$presets, $name)) {
            return (array)$presets;
        }

        return [];
    }
386360
private function createIdentifierMap(array $names) : array
    {
        $identifiers = [];

        foreach ($names as $name) {
            $identifiers[$name] = new Identifier($name);
        }

        return $identifiers;
    }
1025836
protected function getDatalistValue(array $names = array()) {

		$services = \hypeJunction\Integration::getServiceProvider();
		foreach ($names as $name) {
			$values[$name] = $services->datalist->get($name);
		}

		return $values;
	}
622899
public function getServiceNamesByType($types, $only_active = false)
    {
        $names = [];
        $map = $this->getServiceNameTypeMap($only_active);
        if (is_string($types)) {
            $types = array_map('trim', explode(',', trim($types, ',')));
        }
        foreach ($map as $name => $type) {
            if (false !== array_search($type, $types)) {
                $names[] = $name;
            }
        }

        return $names;
    }
1358115
protected static function doFindFilters(array $filters, array $enabledFilters, $all)
    {
        $reactivateFilters = [];

        foreach ($enabledFilters as $name => $filter) {
            if (\in_array($name, $filters, true) || $all) {
                $reactivateFilters[] = $name;
            }
        }

        return $reactivateFilters;
    }
626436
public function enableFilters(array $names) {
        foreach ($names as $name) {
            $filter = array_get($this->filters, $name);

            if ( ! $filter instanceof IRouteFilter) {
                throw new FilterNotFoundException(
                    s('Filter with name %s not found.', $name)
                );
            }

            $filter->setEnabled(true);
        }
    }
1277979
public function getSources(array $names)
    {
        $self = $this;

        return array_map(function ($name) use ($self) {
            return $self->getSource($name);
        }, $names);
    }
1221225
public function loadOverrides($names) {
    $overrides = [];

    // Override post photo default.
    $config_names = [
      'core.entity_view_display.post.photo.activity',
      'core.entity_view_display.post.photo.default',
    ];

    foreach ($config_names as $config_name) {
      if (in_array($config_name, $names)) {
        $overrides[$config_name] = [
          'content' => [
            'like_and_dislike' => [
              'weight' => 2,
              'settings' => [],
              'third_party_settings' => [],
            ],
          ],
        ];
      }
    }

    return $overrides;
  }
501436
protected function commandsNamed(array $names)
    {
        return collect($this->commands)->filter(function ($command) use ($names) {
            return in_array($command->name, $names);
        });
    }
132380
protected function types(array $types): array
    {
        $results = [];
        foreach ($types as $type)
        {
            $results[] = $this->types[$type];
        }

        return $results;
    }
839930
private function getEnabledItemTypes(array $itemTypes): array
    {
        $allItemTypes = array_flip(
            array_map(
                static function (Configuration $config): string {
                    return $config->getItemName();
                },
                $this->configRegistry->getConfigs()
            )
        );

        if (count($itemTypes) === 0) {
            return $allItemTypes;
        }

        return array_filter(
            $allItemTypes,
            static function (string $itemType) use ($itemTypes): bool {
                return in_array($itemType, $itemTypes, true);
            }
        );
    }
61114
public function getTypeProperty($name)
    {
        $return = [];
        $types = $this->getTypes();

        foreach ($types as $type) {
            $return[] = $type->{$name};
        }

        return $return;
    }
969009
public function findAllByName($name)
    {
        $datasourceNodes = array();
        foreach ($this->findAll() as $datasourceNode) {
            if ($datasourceNode->getName() === $name) {
                $datasourceNodes[$datasourceNode->getPrimaryKey()] = $datasourceNode;
            }
        }

        return $datasourceNodes;
    }
506563
public function loadOrCreateTags(array $names)
    {
        if (empty($names)) {
            return array();
        }

        $names = array_unique($names);

        $builder = $this->em->createQueryBuilder();

        $tags = $builder
            ->select('t')
            ->from($this->tagClass, 't')

            ->where($builder->expr()->in('t.name', $names))

            ->getQuery()
            ->getResult()
        ;

        $loadedNames = array();
        foreach ($tags as $tag) {
            $loadedNames[] = $tag->getName();
        }

        $missingNames = array_udiff($names, $loadedNames, 'strcasecmp');
        if (sizeof($missingNames)) {
            foreach ($missingNames as $name) {
                $tag = $this->createTag($name);
                $this->em->persist($tag);

                $tags[] = $tag;
            }

            $this->em->flush();
        }

        return $tags;
    }