/**
  * {@inheritdoc}
  */
 public function __construct(array $values)
 {
     if (!array_key_exists('data', $values)) {
         throw InvalidArgumentException::expectedIndex('data');
     }
     parent::__construct(['data' => new Collection($values['data'])]);
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function __construct(array $values)
 {
     if (!array_key_exists('data', $values)) {
         throw InvalidArgumentException::expectedIndex('data');
     }
     $items = [];
     foreach ($values['data'] as $series) {
         $items[] = new Series(['data' => $series]);
     }
     parent::__construct(['data' => new Collection($items)]);
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function __construct(array $values)
 {
     if (!array_key_exists('data', $values)) {
         throw InvalidArgumentException::expectedIndex('data');
     }
     if (!array_key_exists('links', $values)) {
         throw InvalidArgumentException::expectedIndex('links');
     }
     $items = [];
     foreach ($values['data'] as $basicEpisode) {
         $items[] = new BasicEpisode($basicEpisode);
     }
     parent::__construct(['data' => new Collection($items), 'links' => new Links($values['links'])]);
 }