Closed lyarinet closed 6 years ago
For now you can access the crew or the cast of a movie by this sample code:
$movie->get('credits')['cast']
$movie->get('credits')['crew']
Notice, that you only receive the credits when you fetching the detailed movie information by id.
This Methods return arrays with Data for Person Objects. I will add functionality to the Movie Class in a Pull Request for accessing these information with a getter Function returning Person Objects.
@asifagaria When the Pull Request is accepted you can call getCast() or getCrew() on a detailed Movie or TvShow Object.
Nice addition!
Not to be nit-picky though. Seems like a little refactoring might be in order. May I suggest using a base data controller? Looks like there several common methods in both the Movie and TV apis.
@webstractions Yeah it was only a quick solution. Refactoring might be in order. You are right.
Please make a example file
@asifagaria With a little patience, you will see it in the next commit. I just noticed @bogdanfinn added an example in the PR he is working on.
@webstractions is right. I added an example for cast and crew. ;)
@webstractions @asifagaria I refactored the Movie and the TVShow classes with a base class for the same methods. Later we should think about refactoring the other classes (Episode, Season, Person, etc.) but i think that should be in another PR. Also we should add some more checks to avoid possible exceptions.
I also added an example for accessing cast and crew pictures from movie and tvshow objects.
@pixelead0 Issue can be closed, because of the merged PR.
how to get crew for movie Persons