1 | <?php |
||
23 | class Taxon extends BaseTaxon implements TaxonInterface |
||
24 | { |
||
25 | use TimestampableTrait; |
||
26 | |||
27 | /** |
||
28 | * @var Collection|ImageInterface[] |
||
29 | */ |
||
30 | protected $images; |
||
31 | |||
32 | public function __construct() |
||
40 | |||
41 | /** |
||
42 | * {@inheritdoc} |
||
43 | */ |
||
44 | public function getImages() |
||
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | public function getImagesByType($type) |
||
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | public function hasImages() |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | public function hasImage(ImageInterface $image) |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | public function addImage(ImageInterface $image) |
||
83 | |||
84 | /** |
||
85 | * {@inheritdoc} |
||
86 | */ |
||
87 | public function removeImage(ImageInterface $image) |
||
94 | |||
95 | /** |
||
96 | * {@inheritdoc} |
||
97 | */ |
||
98 | public static function getTranslationClass() |
||
102 | } |
||
103 |
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: