|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace vfalies\tmdb\Items; |
|
4
|
|
|
|
|
5
|
|
|
use vfalies\tmdb\Abstracts\Item; |
|
6
|
|
|
use vfalies\tmdb\Interfaces\PeopleInterface; |
|
7
|
|
|
use vfalies\tmdb\Tmdb; |
|
8
|
|
|
|
|
9
|
|
|
class People extends Item implements PeopleInterface |
|
10
|
|
|
{ |
|
11
|
|
|
|
|
12
|
|
|
/** |
|
13
|
|
|
* Constructor |
|
14
|
|
|
* @param \vfalies\tmdb\Tmdb $tmdb |
|
15
|
|
|
* @param int $people_id |
|
16
|
|
|
* @param array $options |
|
17
|
|
|
* @throws Exception |
|
18
|
|
|
*/ |
|
19
|
28 |
|
public function __construct(Tmdb $tmdb, $people_id, array $options = array()) |
|
20
|
|
|
{ |
|
21
|
28 |
|
parent::__construct($tmdb, $people_id, $options, 'people'); |
|
22
|
27 |
|
} |
|
23
|
|
|
|
|
24
|
2 |
|
public function getAdult() |
|
25
|
|
|
{ |
|
26
|
2 |
|
if (isset($this->data->adult)) |
|
27
|
|
|
{ |
|
28
|
1 |
|
return $this->data->adult; |
|
29
|
|
|
} |
|
30
|
1 |
|
return false; |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
2 |
|
public function getAlsoKnownAs() |
|
34
|
|
|
{ |
|
35
|
2 |
|
if (isset($this->data->also_known_as)) |
|
36
|
|
|
{ |
|
37
|
1 |
|
return $this->data->also_known_as; |
|
38
|
|
|
} |
|
39
|
1 |
|
return []; |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
2 |
|
public function getBiography() |
|
43
|
|
|
{ |
|
44
|
2 |
|
if (isset($this->data->biography)) |
|
45
|
|
|
{ |
|
46
|
1 |
|
return $this->data->biography; |
|
47
|
|
|
} |
|
48
|
1 |
|
return ''; |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
2 |
|
public function getBirthday() |
|
52
|
|
|
{ |
|
53
|
2 |
|
if (isset($this->data->birthday)) |
|
54
|
|
|
{ |
|
55
|
1 |
|
return $this->data->birthday; |
|
56
|
|
|
} |
|
57
|
1 |
|
return ''; |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
2 |
|
public function getDeathday() |
|
61
|
|
|
{ |
|
62
|
2 |
|
if (isset($this->data->deathday)) |
|
63
|
|
|
{ |
|
64
|
1 |
|
return $this->data->deathday; |
|
65
|
|
|
} |
|
66
|
1 |
|
return ''; |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
2 |
|
public function getGender() |
|
70
|
|
|
{ |
|
71
|
2 |
|
if (isset($this->data->gender)) |
|
72
|
|
|
{ |
|
73
|
1 |
|
return $this->data->gender; |
|
74
|
|
|
} |
|
75
|
1 |
|
return 0; |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
2 |
|
public function getHomepage() |
|
79
|
|
|
{ |
|
80
|
2 |
|
if (isset($this->data->homepage)) |
|
81
|
|
|
{ |
|
82
|
1 |
|
return $this->data->homepage; |
|
83
|
|
|
} |
|
84
|
1 |
|
return ''; |
|
85
|
|
|
} |
|
86
|
|
|
|
|
87
|
3 |
|
public function getId() |
|
88
|
|
|
{ |
|
89
|
3 |
|
if (isset($this->data->id)) |
|
90
|
|
|
{ |
|
91
|
2 |
|
return $this->data->id; |
|
92
|
|
|
} |
|
93
|
1 |
|
return 0; |
|
94
|
|
|
} |
|
95
|
|
|
|
|
96
|
2 |
|
public function getImdbId() |
|
97
|
|
|
{ |
|
98
|
2 |
|
if (isset($this->data->imdb_id)) |
|
99
|
|
|
{ |
|
100
|
1 |
|
return $this->data->imdb_id; |
|
101
|
|
|
} |
|
102
|
1 |
|
return ''; |
|
103
|
|
|
} |
|
104
|
|
|
|
|
105
|
2 |
|
public function getName() |
|
106
|
|
|
{ |
|
107
|
2 |
|
if (isset($this->data->name)) |
|
108
|
|
|
{ |
|
109
|
1 |
|
return $this->data->name; |
|
110
|
|
|
} |
|
111
|
1 |
|
return ''; |
|
112
|
|
|
} |
|
113
|
|
|
|
|
114
|
2 |
|
public function getPlaceOfBirth() |
|
115
|
|
|
{ |
|
116
|
2 |
|
if (isset($this->data->place_of_birth)) |
|
117
|
|
|
{ |
|
118
|
1 |
|
return $this->data->place_of_birth; |
|
119
|
|
|
} |
|
120
|
1 |
|
return ''; |
|
121
|
|
|
} |
|
122
|
|
|
|
|
123
|
2 |
|
public function getPopularity() |
|
124
|
|
|
{ |
|
125
|
2 |
|
if (isset($this->data->popularity)) |
|
126
|
|
|
{ |
|
127
|
1 |
|
return $this->data->popularity; |
|
128
|
|
|
} |
|
129
|
1 |
|
return 0; |
|
130
|
|
|
} |
|
131
|
|
|
|
|
132
|
2 |
|
public function getProfilePath() |
|
133
|
|
|
{ |
|
134
|
2 |
|
if (isset($this->data->profile_path)) |
|
135
|
|
|
{ |
|
136
|
1 |
|
return $this->data->profile_path; |
|
137
|
|
|
} |
|
138
|
1 |
|
return ''; |
|
139
|
|
|
} |
|
140
|
|
|
|
|
141
|
|
|
} |
|
142
|
|
|
|