| 1 | <?php |
||
| 9 | class Company extends Results implements CompanyResultsInterface |
||
| 10 | { |
||
| 11 | |||
| 12 | protected $name = null; |
||
| 13 | protected $logo_path = null; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Constructor |
||
| 17 | * @param \vfalies\tmdb\Tmdb $tmdb |
||
| 18 | * @param \stdClass $result |
||
| 19 | */ |
||
| 20 | 4 | public function __construct(Tmdb $tmdb, \stdClass $result) |
|
| 29 | |||
| 30 | 1 | public function getId() |
|
| 34 | |||
| 35 | 1 | public function getLogoPath() |
|
| 39 | |||
| 40 | 1 | public function getName() |
|
| 44 | |||
| 45 | } |
||
| 46 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: