Skip to content

Commit

Permalink
Merge pull request #42 from mihaeu/added-spoken-languages-to-movie
Browse files Browse the repository at this point in the history
Added spoken languages for movie hydration.
  • Loading branch information
wtfzdotnet committed Jul 31, 2014
2 parents 6e46bc5 + 00633f0 commit 0c72e82
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/Tmdb/Factory/MovieFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Tmdb\Factory\People\CrewFactory;
use Tmdb\Model\Common\Country;
use Tmdb\Model\Common\GenericCollection;
use Tmdb\Model\Common\SpokenLanguage;
use Tmdb\Model\Common\Translation;
use Tmdb\Model\Company;
use Tmdb\Model\Movie;
Expand Down Expand Up @@ -186,6 +187,12 @@ public function create(array $data = array())
);
}

if (array_key_exists('spoken_languages', $data)) {
$movie->setSpokenLanguages(
$this->createGenericCollection($data['spoken_languages'], new SpokenLanguage())
);
}

return $this->hydrate($movie, $data);
}

Expand Down

0 comments on commit 0c72e82

Please sign in to comment.