1: | <?php |
2: | namespace Duyplus\TMDBApi\Classes\Roles; |
3: | |
4: | use Duyplus\TMDBApi\Classes\Data\Role; |
5: | |
6: | class TVShowRole extends Role |
7: | { |
8: | //------------------------------------------------------------------------------ |
9: | // Class Variables |
10: | //------------------------------------------------------------------------------ |
11: | |
12: | /** |
13: | * Construct Class |
14: | * |
15: | * @param array $data An array with the data of a TVShowRole |
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 TVShow's title of the role |
29: | * |
30: | * @return string |
31: | */ |
32: | public function getTVShowName() |
33: | { |
34: | return $this->crawl['name']; |
35: | } |
36: | |
37: | /** |
38: | * Get the TVShow's id |
39: | * |
40: | * @return int |
41: | */ |
42: | public function getTVShowID() |
43: | { |
44: | return $this->crawl['id']; |
45: | } |
46: | |
47: | /** |
48: | * Get the TVShow's original title of the role |
49: | * |
50: | * @return string |
51: | */ |
52: | public function getTVShowOriginalTitle() |
53: | { |
54: | return $this->crawl['original_name']; |
55: | } |
56: | |
57: | /** |
58: | * Get the TVShow's release date of the role |
59: | * |
60: | * @return string |
61: | */ |
62: | public function getTVShowFirstAirDate() |
63: | { |
64: | return $this->crawl['first_air_date']; |
65: | } |
66: | |
67: | //------------------------------------------------------------------------------ |
68: | // Export |
69: | //------------------------------------------------------------------------------ |
70: | |
71: | /** |
72: | * Get the JSON representation of the TVShowRole |
73: | * |
74: | * @return string |
75: | */ |
76: | public function getJSON() |
77: | { |
78: | return json_encode($this->crawl, JSON_PRETTY_PRINT); |
79: | } |
80: | } |