1: <?php
2: namespace duyplus\tmdbapi\classes\data;
3:
4: /**
5: * This class handles all the data you can get from the api Configuration
6: *
7: * @package TMDB_V3_API_PHP
8: * @author Alvaro Octal
9: * @version 0.7
10: * @date 20/01/2015
11: * @updated 31/12/2024
12: * @link https://github.com/duyplus/tmdbapi
13: * @copyright Licensed under BSD (http://www.opensource.org/licenses/bsd-license.php)
14: */
15:
16: class Role
17: {
18: //------------------------------------------------------------------------------
19: // Class Variables
20: //------------------------------------------------------------------------------
21:
22: private $_data;
23:
24: /**
25: * Construct Class
26: *
27: * @param array $data An array with the data of a Role
28: */
29: protected function __construct($data, $ipPerson)
30: {
31: $this->_data = $data;
32: $this->_data['person_id'] = $ipPerson;
33: }
34:
35: //------------------------------------------------------------------------------
36: // Get Variables
37: //------------------------------------------------------------------------------
38:
39: /**
40: * Get the Role's character
41: *
42: * @return string
43: */
44: public function getCharacter()
45: {
46: return $this->_data['character'];
47: }
48:
49: /**
50: * Get the Movie's poster
51: *
52: * @return string
53: */
54: public function getPoster()
55: {
56: return $this->_data['poster_path'];
57: }
58:
59: /**
60: * Get Generic.<br>
61: * Get a item of the array, you should not get used to use this, better use specific get's.
62: *
63: * @param string $item The item of the $data array you want
64: * @return array
65: */
66: public function get($item = '')
67: {
68: return (empty($item)) ? $this->_data : $this->_data[$item];
69: }
70: }
71: ?>