Exemplo n.º 1
0
 /**
  * Map child collections
  *
  * @param string $className
  * @param array $properties
  *
  * @return array
  * @throws Exception
  */
 protected function mapCollections($className, array $properties)
 {
     $collectionFactory = new CollectionFactory();
     foreach ($className::$collectionMapping as $property => $collectionType) {
         if (isset($properties[$property]) && is_array($properties[$property])) {
             $properties[$property] = $collectionFactory->create($collectionType, $properties);
         }
     }
     return $properties;
 }
Exemplo n.º 2
0
 public function setUp()
 {
     parent::setUp();
     $collectionFactory = new CollectionFactory();
     $this->collection = $collectionFactory->create('PickBanSequence', ['picks_bans' => [['is_pick' => false, 'team' => 1, 'order' => 0], ['is_pick' => false, 'team' => 0, 'order' => 1], ['is_pick' => false, 'team' => 1, 'order' => 2], ['is_pick' => false, 'team' => 0, 'order' => 3], ['is_pick' => true, 'team' => 0, 'order' => 5]]]);
 }
Exemplo n.º 3
0
 /**
  * Get collection from response.
  *
  * @param string $collectionType
  *
  * @return Collection
  * @throws Exception
  */
 public function getCollection($collectionType)
 {
     $collectionFactory = new CollectionFactory();
     return $collectionFactory->create($collectionType, $this->getResult());
 }
Exemplo n.º 4
0
 public function setUp()
 {
     parent::setUp();
     $collectionFactory = new CollectionFactory();
     $this->collection = $collectionFactory->create('Collection', ['results_remaining' => 490, 'total_results' => 500]);
 }
Exemplo n.º 5
0
 public function setUp()
 {
     parent::setUp();
     $collectionFactory = new CollectionFactory();
     $this->collection = $collectionFactory->create('Slot', ['players' => [['account_id' => 22785577, 'player_slot' => 0, 'hero_id' => 50], ['account_id' => 249464271, 'player_slot' => 1, 'hero_id' => 13], ['account_id' => 319242370, 'player_slot' => 2, 'hero_id' => 89], ['account_id' => 4294967295, 'player_slot' => 3, 'hero_id' => 15], ['account_id' => 136600575, 'player_slot' => 4, 'hero_id' => 51], ['account_id' => 4294967295, 'player_slot' => 128, 'hero_id' => 76], ['account_id' => 118997978, 'player_slot' => 129, 'hero_id' => 45], ['account_id' => 92987127, 'player_slot' => 130, 'hero_id' => 80], ['account_id' => 4294967295, 'player_slot' => 131, 'hero_id' => 31], ['account_id' => 4294967295, 'player_slot' => 132, 'hero_id' => 30]]]);
 }
Exemplo n.º 6
0
 public function setUp()
 {
     parent::setUp();
     $collectionFactory = new CollectionFactory();
     $this->collection = $collectionFactory->create('Player', ['players' => [['account_id' => 22785577, 'player_slot' => 0, 'hero_id' => 50], ['account_id' => 249464271, 'player_slot' => 1, 'hero_id' => 13]]]);
 }
Exemplo n.º 7
0
 public function setUp()
 {
     parent::setUp();
     $collectionFactory = new CollectionFactory();
     $this->collection = $collectionFactory->create('Match', ['results_remaining' => 490, 'total_results' => 500, 'matches' => [['match_id' => 2328989387, 'match_seq_num' => 2040184605], ['match_id' => 2328989381, 'match_seq_num' => 2040184606], ['match_id' => 2328989382, 'match_seq_num' => 2040184607]]]);
 }