1 | <?php declare(strict_types=1); |
||
29 | class Account |
||
30 | { |
||
31 | /** |
||
32 | * Tmdb object |
||
33 | * @var TmdbInterface |
||
34 | */ |
||
35 | private $tmdb = null; |
||
36 | /** |
||
37 | * Logger object |
||
38 | * @var \Psr\Log\LoggerInterface |
||
39 | */ |
||
40 | private $logger = null; |
||
41 | /** |
||
42 | * Session id string |
||
43 | * @var string |
||
44 | */ |
||
45 | private $session_id = null; |
||
46 | /** |
||
47 | * Data |
||
48 | * @var \stdClass |
||
49 | */ |
||
50 | private $data = null; |
||
51 | /** |
||
52 | * Configuration |
||
53 | * @var \stdClass |
||
54 | */ |
||
55 | protected $conf; |
||
56 | /** |
||
57 | * Account Id |
||
58 | * @var int |
||
59 | */ |
||
60 | protected $account_id; |
||
61 | |||
62 | /** |
||
63 | * Constructor |
||
64 | * @param TmdbInterface $tmdb |
||
65 | * @param string $session_id |
||
66 | */ |
||
67 | 36 | public function __construct(TmdbInterface $tmdb, string $session_id) |
|
81 | |||
82 | /** |
||
83 | * Get an account list |
||
84 | * @param string $type class name of the type of list (possible value : Favorite, Rated, WatchList) |
||
85 | * @param array $options |
||
86 | * @return mixed |
||
87 | */ |
||
88 | 28 | private function getList(string $type, array $options = array()) |
|
95 | |||
96 | /** |
||
97 | * Get account favorite elements |
||
98 | * @param array $options |
||
99 | * @return Favorite |
||
100 | */ |
||
101 | 8 | public function getFavorite(array $options = array()) : Favorite |
|
105 | |||
106 | /** |
||
107 | * Get account rated elements |
||
108 | * @param array $options |
||
109 | * @return Rated |
||
110 | */ |
||
111 | 12 | public function getRated(array $options = array()) : Rated |
|
115 | |||
116 | /** |
||
117 | * Get account watchlist elements |
||
118 | * @param array $options |
||
119 | * @return WatchList |
||
120 | */ |
||
121 | 8 | public function getWatchList(array $options = array()) : WatchList |
|
125 | |||
126 | /** |
||
127 | * Get account id |
||
128 | * @return int account id |
||
129 | */ |
||
130 | 16 | public function getId() : int |
|
134 | |||
135 | /** |
||
136 | * Get account language |
||
137 | * @return string language code in standard ISO 639_1 |
||
138 | */ |
||
139 | 1 | public function getLanguage() : string |
|
143 | |||
144 | /** |
||
145 | * Get country code |
||
146 | * @return string country code in standard ISO 3166_1 |
||
147 | */ |
||
148 | 1 | public function getCountry() : string |
|
152 | |||
153 | /** |
||
154 | * Get account name |
||
155 | * @return string account name |
||
156 | */ |
||
157 | 1 | public function getName() : string |
|
161 | |||
162 | /** |
||
163 | * Get account username |
||
164 | * @return string account username |
||
165 | */ |
||
166 | 1 | public function getUsername() : string |
|
170 | |||
171 | /** |
||
172 | * Get Gravatar hash |
||
173 | * @return string gravatar hash |
||
174 | */ |
||
175 | 1 | public function getGravatarHash() : string |
|
179 | |||
180 | /** |
||
181 | * Get if account include adult content |
||
182 | * @return bool |
||
183 | */ |
||
184 | 1 | public function getIncludeAdult() : bool |
|
188 | } |
||
189 |