1: <?php
2: namespace duyplus\tmdbapi\classes\roles;
3:
4: use duyplus\tmdbapi\classes\data\Role;
5:
6: /**
7: * This class handles all the data you can get from the api Configuration
8: *
9: * @package TMDB_V3_API_PHP
10: * @author Alvaro Octal
11: * @version 0.7
12: * @date 20/01/2015
13: * @updated 31/12/2024
14: * @link https://github.com/duyplus/tmdbapi
15: * @copyright Licensed under BSD (http://www.opensource.org/licenses/bsd-license.php)
16: */
17:
18: class MovieRole extends Role
19: {
20: //------------------------------------------------------------------------------
21: // Class Variables
22: //------------------------------------------------------------------------------
23:
24: private $_data;
25:
26: /**
27: * Construct Class
28: *
29: * @param array $data An array with the data of a MovieRole
30: */
31: public function __construct($data, $idPerson)
32: {
33: $this->_data = $data;
34: parent::__construct($data, $idPerson);
35: }
36:
37: //------------------------------------------------------------------------------
38: // Get Variables
39: //------------------------------------------------------------------------------
40:
41: /**
42: * Get the Movie's title of the role
43: *
44: * @return string
45: */
46: public function getMovieTitle()
47: {
48: return $this->_data['title'];
49: }
50:
51: /**
52: * Get the Movie's id
53: *
54: * @return int
55: */
56: public function getMovieID()
57: {
58: return $this->_data['id'];
59: }
60:
61: /**
62: * Get the Movie's original title of the role
63: *
64: * @return string
65: */
66: public function getMovieOriginalTitle()
67: {
68: return $this->_data['original_title'];
69: }
70:
71: /**
72: * Get the Movie's release date of the role
73: *
74: * @return string
75: */
76: public function getMovieReleaseDate()
77: {
78: return $this->_data['release_date'];
79: }
80:
81: //------------------------------------------------------------------------------
82: // Export
83: //------------------------------------------------------------------------------
84:
85: /**
86: * Get the JSON representation of the Episode
87: *
88: * @return string
89: */
90: public function getJSON()
91: {
92: return json_encode($this->_data, JSON_PRETTY_PRINT);
93: }
94: }
95: ?>