/**
  * {@inheritdoc}
  */
 public function __construct(array $values)
 {
     if (!array_key_exists('data', $values)) {
         throw InvalidArgumentException::expectedIndex('data');
     }
     parent::__construct(['data' => new Collection($values['data'])]);
 }
Exemplo n.º 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)]);
 }
Exemplo n.º 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'])]);
 }