LeagueWrap\Api\Summoner::infoByIds PHP Method

infoByIds() protected method

Gets the information by the id of the summoner.
protected infoByIds ( array $ids ) : LeagueWrap\Dto\Summoner | LeagueWrap\Dto\Summoner[];
$ids array
return LeagueWrap\Dto\Summoner | LeagueWrap\Dto\Summoner[];
    protected function infoByIds($ids)
    {
        if (count($ids) > 40) {
            throw new ListMaxException('This request can only support a list of 40 elements, ' . count($ids) . ' given.');
        }
        $idList = implode(',', $ids);
        $array = $this->request('summoner/' . $idList);
        $summoners = [];
        foreach ($array as $info) {
            $summoner = $this->attachStaticDataToDto(new Dto\Summoner($info));
            $name = $summoner->name;
            $this->summoners[$name] = $summoner;
            $summoners[$name] = $summoner;
        }
        return $summoners;
    }