1
|
|
|
<?php declare(strict_types = 1); |
2
|
|
|
/** |
3
|
|
|
* This file is part of the Tmdb package. |
4
|
|
|
* |
5
|
|
|
* (c) Vincent Faliès <[email protected]> |
6
|
|
|
* |
7
|
|
|
* For the full copyright and license information, please view the LICENSE |
8
|
|
|
* file that was distributed with this source code. |
9
|
|
|
* |
10
|
|
|
* @author Vincent Faliès <[email protected]> |
11
|
|
|
* @copyright Copyright (c) 2017 |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
|
15
|
|
|
namespace VfacTmdb\Results; |
16
|
|
|
|
17
|
|
|
use VfacTmdb\Abstracts\Results; |
18
|
|
|
use VfacTmdb\Interfaces\Results\CompanyResultsInterface; |
19
|
|
|
use VfacTmdb\Interfaces\TmdbInterface; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Class to manipulate a company result |
23
|
|
|
* @package Tmdb |
24
|
|
|
* @author Vincent Faliès <[email protected]> |
25
|
|
|
* @copyright Copyright (c) 2017 |
26
|
|
|
*/ |
27
|
|
|
class Company extends Results implements CompanyResultsInterface |
28
|
|
|
{ |
29
|
|
|
/** |
30
|
|
|
* Collection name |
31
|
|
|
* @var string |
32
|
|
|
*/ |
33
|
|
|
protected $name = null; |
34
|
|
|
/** |
35
|
|
|
* Collection image logo path |
36
|
|
|
* @var string |
37
|
|
|
*/ |
38
|
|
|
protected $logo_path = null; |
39
|
|
|
/** |
40
|
|
|
* Collection Id |
41
|
|
|
* @var int |
42
|
|
|
*/ |
43
|
|
|
protected $id = null; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* Constructor |
47
|
|
|
* @param TmdbInterface $tmdb |
48
|
|
|
* @param \stdClass $result |
49
|
|
|
*/ |
50
|
5 |
|
public function __construct(TmdbInterface $tmdb, \stdClass $result) |
51
|
|
|
{ |
52
|
5 |
|
parent::__construct($tmdb, $result); |
53
|
|
|
|
54
|
|
|
// Populate data |
55
|
5 |
|
$this->id = $this->data->id; |
56
|
5 |
|
$this->name = $this->data->name; |
57
|
5 |
|
$this->logo_path = $this->data->logo_path; |
58
|
5 |
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* Collection id |
62
|
|
|
* @return int |
63
|
|
|
*/ |
64
|
1 |
|
public function getId() : int |
65
|
|
|
{ |
66
|
1 |
|
return $this->id; |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* Image logo path |
71
|
|
|
* @return string |
72
|
|
|
*/ |
73
|
1 |
|
public function getLogoPath() : string |
74
|
|
|
{ |
75
|
1 |
|
return $this->logo_path; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* Collection name |
80
|
|
|
* @return string |
81
|
|
|
*/ |
82
|
2 |
|
public function getName() : string |
83
|
|
|
{ |
84
|
2 |
|
return $this->name; |
85
|
|
|
} |
86
|
|
|
} |
87
|
|
|
|