|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace vfalies\tmdb; |
|
4
|
|
|
|
|
5
|
|
|
use vfalies\tmdb\Items\Movie; |
|
6
|
|
|
use vfalies\tmdb\Items\Collection; |
|
7
|
|
|
use vfalies\tmdb\Items\TVShow; |
|
8
|
|
|
use vfalies\tmdb\Items\People; |
|
9
|
|
|
|
|
10
|
|
|
class Item |
|
11
|
|
|
{ |
|
12
|
|
|
|
|
13
|
|
|
private $tmdb = null; |
|
14
|
|
|
private $logger = null; |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* Constructor |
|
18
|
|
|
* @param \vfalies\tmdb\Tmdb $tmdb |
|
19
|
|
|
*/ |
|
20
|
|
|
|
|
21
|
4 |
|
public function __construct(Tmdb $tmdb) |
|
22
|
|
|
{ |
|
23
|
4 |
|
$this->tmdb = $tmdb; |
|
24
|
4 |
|
$this->logger = $tmdb->logger; |
|
25
|
4 |
|
} |
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* Get movie details |
|
29
|
|
|
* @param int $movie_id |
|
30
|
|
|
* @param array $options |
|
31
|
|
|
* @return \vfalies\tmdb\Items\Movie |
|
32
|
|
|
*/ |
|
33
|
1 |
|
public function getMovie($movie_id, array $options = array()) |
|
34
|
|
|
{ |
|
35
|
1 |
|
$this->logger->debug('Starting getting movie'); |
|
36
|
1 |
|
$movie = new Movie($this->tmdb, $movie_id, $options); |
|
37
|
|
|
|
|
38
|
1 |
|
return $movie; |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* Get collection details |
|
43
|
|
|
* @param int $collection_id |
|
44
|
|
|
* @param array $options |
|
45
|
|
|
* @return \vfalies\tmdb\Items\Collection |
|
46
|
|
|
*/ |
|
47
|
1 |
|
public function getCollection($collection_id, array $options = array()) |
|
48
|
|
|
{ |
|
49
|
1 |
|
$this->logger->debug('Starting getting collection'); |
|
50
|
1 |
|
$collection = new Collection($this->tmdb, $collection_id, $options); |
|
51
|
|
|
|
|
52
|
1 |
|
return $collection; |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* Get TV Show details |
|
57
|
|
|
* @param int $tv_id |
|
58
|
|
|
* @param array $options |
|
59
|
|
|
* @return \vfalies\tmdb\Items\TVShow |
|
60
|
|
|
*/ |
|
61
|
1 |
|
public function getTVShow($tv_id, array $options = array()) |
|
62
|
|
|
{ |
|
63
|
1 |
|
$this->logger->debug('Starting getting tvshow'); |
|
64
|
1 |
|
$tv = new TVShow($this->tmdb, $tv_id, $options); |
|
65
|
|
|
|
|
66
|
1 |
|
return $tv; |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
/** |
|
70
|
|
|
* Get People details |
|
71
|
|
|
* @param int $people_id |
|
72
|
|
|
* @param array $options |
|
73
|
|
|
* @return \vfalies\tmdb\Items\People |
|
74
|
|
|
*/ |
|
75
|
1 |
|
public function getPeople($people_id, array $options = array()) |
|
76
|
|
|
{ |
|
77
|
1 |
|
$this->logger->debug('Starting getting people'); |
|
78
|
1 |
|
$people = new People($this->tmdb, $people_id, $options); |
|
79
|
|
|
|
|
80
|
1 |
|
return $people; |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
} |
|
84
|
|
|
|