Gets the information by the name of the summoner.

@param array $names
@return Dto\Summoner|Dto\Summoner[];
@throws ListMaxException
344318
protected function infoByNames(array $names)
	{
		if (count($names) > 40)
		{
			throw new ListMaxException('this request can only support a list of 40 elements, '.count($names).' given.');
		}
		$nameList = implode(',', $names);

		// clean the name
		$nameList  = htmlspecialchars($nameList);
		$array     = $this->request('summoner/by-name/'.$nameList);
		$summoners = [];

		if ( ! empty($array))
		{
			foreach ($array as $name => $info)
			{
				$summoner               = $this->attachStaticDataToDto(new Dto\Summoner($info));
				$this->summoners[$name] = $summoner;
				$summoners[$name]       = $summoner;
			}
		}

		return $summoners;
	}
599344
public static function toNamedArray(array $data, array $names)
    {
        $tmp = [];
        if (count($data) !== count($names)) {
            throw new \RuntimeException("data and names lengths do not match");
        }
        $i = 0;
        foreach ($names as $name) {
            if (!isset($data[$i])) {
                throw new \RuntimeException("data is not indexed form 0,1, ... Index $i is missing!");
            }
            $tmp[$name] = $data[$i];
            ++$i;
        }
        return $tmp;
    }
1135092
public function all($name)
    {
        $items = [];

        if ($this->hasValue($name)) {
            $items[] = $this->getValue($name);
        }

        foreach ($this->getStructures() as $childStructure) {
            $items = array_merge($items, $childStructure->all($name));
        }

        return $items;
    }
50597
public function getDestinations(array $names)
    {
        $self = $this;

        return array_map(function ($name) use ($self) {
            return $self->getDestination($name);
        }, $names);
    }
11700
public function attributes(array $names = null)
    {
        if (!$this->node instanceof DOMElement) {
            return null;
        }

        if ($names === null) {
            $result = [];

            foreach ($this->node->attributes as $name => $attribute) {
                $result[$name] = $attribute->value;
            }

            return $result;
        }

        $result = [];

        foreach ($this->node->attributes as $name => $attribute) {
            if (in_array($name, $names, true)) {
                $result[$name] = $attribute->value;
            }
        }

        return $result;
    }
1218289
public static function getDataFiles(array $names, $dataDir = null)
    {
        $dirs = ($dataDir === null) ? self::getDataDirs() : [$dataDir];

        return self::getRealFiles($dirs, $names);
    }
992486
public function getByName($name)
    {
        if (!isset($this->nameMap[$name])) {
            return null;
        }

        return $this->get($this->nameMap[$name]);
    }
1058609
public function exclude(array $names)
    {
        $filtered = clone $this;
        foreach ($names as $name) {
            unset($filtered[$name]);
        }
        return $filtered;
    }
272150
public function getAll($name)
    {
        $s = $this->getNormalizedHeaderName($name);
        $ret = [];
        if (!empty($this->headerMap[$s])) {
            foreach ($this->headerMap[$s] as $index) {
                $ret[] = $this->getByIndex($index);
            }
        }
        return $ret;
    }
1219688
public function masteryPages($identities)
	{
		$ids = $this->extractIds($identities);
		$ids = implode(',', $ids);

		$array     = $this->request('summoner/'.$ids.'/masteries');
		$summoners = [];
		foreach ($array as $summonerId => $data)
		{
			$masteryPages = [];
			foreach ($data['pages'] as $info)
			{
				if ( ! isset($info['masteries']))
				{
					// seting the talents to an empty array
					$info['masteries'] = [];
				}

				$masteriesInfo = $info['masteries'];
				unset($info['masteries']);
				$masteryPage = $this->attachStaticDataToDto(new MasteryPage($info));
				// set masterys
				$masteries = [];
				foreach ($masteriesInfo as $mastery)
				{
					$id             = $mastery['id'];
					$mastery        = $this->attachStaticDataToDto(new Mastery($mastery));
					$masteries[$id] = $mastery;
				}
				$masteryPage->masteries = $masteries;
				$masteryPages[]         = $masteryPage;
			}
			$summoners[$summonerId] = $masteryPages;
		}

		$this->attachResponses($identities, $summoners, 'masteryPages');

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

        return $datasourceNodes;
    }
896195
private function getFilesMaxAge($path, $names = array(), $default = 0)
    {
        $finder = new Finder();
        $finder->files()->in(realpath($path))->ignoreDotFiles(true);
        foreach ($names as $name) {
            $finder->name($name);
        }
        $ages = array();
        foreach ($finder as $file) {
            $ages[] = filemtime($file);
        }
        return max(array_merge($ages, array($default)));
    }
1302611
public function getItemChildren($names)
	{
		if(is_string($names))
			$condition='parent='.$this->db->quoteValue($names);
		elseif(is_array($names) && $names!==array())
		{
			foreach($names as &$name)
				$name=$this->db->quoteValue($name);
			$condition='parent IN ('.implode(', ',$names).')';
		}

		$rows=$this->db->createCommand()
			->select('name, type, description, bizrule, data')
			->from(array(
				$this->itemTable,
				$this->itemChildTable
			))
			->where($condition.' AND name=child')
			->queryAll();

		$children=array();
		foreach($rows as $row)
		{
			if(($data=@unserialize($row['data']))===false)
				$data=null;
			$children[$row['name']]=new CAuthItem($this,$row['name'],$row['type'],$row['description'],$row['bizrule'],$data);
		}
		return $children;
	}
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);
	}
237613
public function only(array $names, $default = null) {
        $var = [];
        
        foreach ($names as $in) {
            $var[$in] = isset($this->_requests[$in]) ? 
                $this->_requests[$in] :
                $default;
        }
        
        return $var;
    }
868429
public function getByName($name)
	{
		return isset($this->nameList[$name]) ? $this->nameList[$name] : null;
	}
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;
    }