示例#1
0
 /**
  * Set up the information about the ItemList Dto.
  *
  * @param array $info
  */
 public function __construct(array $info)
 {
     if (isset($info['data'])) {
         $data = [];
         foreach ($info['data'] as $itemId => $item) {
             $itemDto = new Item($item);
             $data[$itemId] = $itemDto;
         }
         $info['data'] = $data;
     }
     if (isset($info['basic'])) {
         $info['basic'] = new BasicData($info['basic']);
     }
     if (isset($info['groups'])) {
         $groups = [];
         foreach ($info['groups'] as $itemId => $group) {
             $groupDto = new Group($group);
             $groups[$itemId] = $groupDto;
         }
         $info['groups'] = $groups;
     }
     if (isset($info['tree'])) {
         $tree = [];
         foreach ($info['tree'] as $itemId => $tree) {
             $itemTreeDto = new ItemTree($tree);
             $tree[$itemId] = $itemTreeDto;
         }
         $info['tree'] = $tree;
     }
     parent::__construct($info);
 }
示例#2
0
 /**
  * @param array $info
  */
 public function __construct(array $info)
 {
     if (isset($info['items'])) {
         $items = [];
         foreach ($info['items'] as $key => $item) {
             $items[$key] = new BlockItem($item);
         }
         $info['items'] = $items;
     }
     parent::__construct($info);
 }
示例#3
0
 public function __construct(array $info)
 {
     if (isset($info['data'])) {
         $spells = [];
         foreach ($info['data'] as $spellId => $spell) {
             $summonerSpellDto = new SummonerSpell($spell);
             $spells[$spellId] = $summonerSpellDto;
         }
         $info['data'] = $spells;
     }
     parent::__construct($info);
 }
示例#4
0
 /**
  * Set up the information about the ChampionList Dto.
  *
  * @param array $info
  */
 public function __construct(array $info)
 {
     if (isset($info['data'])) {
         $data = [];
         foreach ($info['data'] as $championId => $champion) {
             $championDto = new Champion($champion);
             $data[$championId] = $championDto;
         }
         $info['data'] = $data;
     }
     parent::__construct($info);
 }
示例#5
0
 public function __construct(array $info)
 {
     if (isset($info['memberList'])) {
         $members = [];
         foreach ($info['memberList'] as $member) {
             $member = new Member($member);
             $members[$member->playerId] = $member;
         }
         $info['memberList'] = $members;
     }
     parent::__construct($info);
 }
 /**
  * @param array $info
  */
 public function __construct(array $info)
 {
     if (isset($info['data'])) {
         $data = [];
         foreach ($info['data'] as $masteryId => $mastery) {
             $masteryDto = new Mastery($mastery);
             $data[$masteryId] = $masteryDto;
         }
         $info['data'] = $data;
     }
     if (isset($info['tree'])) {
         $info['tree'] = new MasteryTree($info['tree']);
     }
     parent::__construct($info);
 }
示例#7
0
 public function __construct(array $info)
 {
     if (isset($info['basic'])) {
         $info['basic'] = new BasicData($info['basic']);
     }
     if (isset($info['data'])) {
         $runes = [];
         foreach ($info['data'] as $runeId => $rune) {
             $runeDto = new Rune($rune);
             $runes[$runeId] = $runeDto;
         }
         $info['data'] = $runes;
     }
     parent::__construct($info);
 }
 /**
  * @param array $info
  */
 public function __construct(array $info)
 {
     if (isset($info['masteryTreeItems'])) {
         $masteryTreeItems = [];
         foreach ($info['masteryTreeItems'] as $treeId => $masteryTreeItem) {
             // fix for null positions in the tree by insertion of dummy items
             if (is_array($masteryTreeItem)) {
                 $masteryTreeItemDto = new MasteryTreeItem($masteryTreeItem);
             } else {
                 $masteryTreeItemDto = new MasteryTreeItem(["prereq" => "0", "masteryId" => 0]);
             }
             $masteryTreeItems[$treeId] = $masteryTreeItemDto;
         }
         $info['masteryTreeItems'] = $masteryTreeItems;
     }
     parent::__construct($info);
 }