/** * {@inheritdoc} * @return \Tmdb\Model\Collection */ public function create(array $data = []) { $collection = new Collection(); if (array_key_exists('parts', $data)) { $collection->setParts($this->getMovieFactory()->createCollection($data['parts'])); } if (array_key_exists('backdrop_path', $data)) { $collection->setBackdropImage($this->getImageFactory()->createFromPath($data['backdrop_path'], 'backdrop_path')); } if (array_key_exists('images', $data)) { $collection->setImages($this->getImageFactory()->createCollectionFromMovie($data['images'])); } if (array_key_exists('poster_path', $data)) { $collection->setPosterImage($this->getImageFactory()->createFromPath($data['poster_path'], 'poster_path')); } return $this->hydrate($collection, $data); }