| 1: | <?php |
| 2: | namespace Duyplus\TMDBApi\Classes\Roles; |
| 3: | |
| 4: | use Duyplus\TMDBApi\Classes\Data\Role; |
| 5: | |
| 6: | class MovieRole extends Role |
| 7: | { |
| 8: | //------------------------------------------------------------------------------ |
| 9: | // Class Variables |
| 10: | //------------------------------------------------------------------------------ |
| 11: | |
| 12: | /** |
| 13: | * Construct Class |
| 14: | * |
| 15: | * @param array $data An array with the data of the MovieRole |
| 16: | * @param int|null $idPerson The Person id |
| 17: | */ |
| 18: | public function __construct($data, $idPerson = null) |
| 19: | { |
| 20: | parent::__construct($data, $idPerson); |
| 21: | } |
| 22: | |
| 23: | //------------------------------------------------------------------------------ |
| 24: | // Get Variables |
| 25: | //------------------------------------------------------------------------------ |
| 26: | |
| 27: | /** |
| 28: | * Get the Movie's title |
| 29: | * |
| 30: | * @return string |
| 31: | */ |
| 32: | public function getMovieTitle() |
| 33: | { |
| 34: | return $this->get('title'); |
| 35: | } |
| 36: | |
| 37: | /** |
| 38: | * Get the Movie's id |
| 39: | * |
| 40: | * @return int |
| 41: | */ |
| 42: | public function getMovieID() |
| 43: | { |
| 44: | return $this->get('id'); |
| 45: | } |
| 46: | |
| 47: | /** |
| 48: | * Get the Movie's original title |
| 49: | * |
| 50: | * @return string |
| 51: | */ |
| 52: | public function getMovieOriginalTitle() |
| 53: | { |
| 54: | return $this->get('original_title'); |
| 55: | } |
| 56: | |
| 57: | /** |
| 58: | * Get the Movie's release date |
| 59: | * |
| 60: | * @return string |
| 61: | */ |
| 62: | public function getMovieReleaseDate() |
| 63: | { |
| 64: | return $this->get('release_date'); |
| 65: | } |
| 66: | |
| 67: | //------------------------------------------------------------------------------ |
| 68: | // Export |
| 69: | //------------------------------------------------------------------------------ |
| 70: | |
| 71: | /** |
| 72: | * Get the JSON representation of the MovieRole |
| 73: | * |
| 74: | * @return string |
| 75: | */ |
| 76: | public function getJSON() |
| 77: | { |
| 78: | return json_encode($this->get(), JSON_PRETTY_PRINT); |
| 79: | } |
| 80: | } |