| 1 | <?php |
||
| 5 | class Post extends PopoloObject |
||
| 6 | { |
||
| 7 | protected $properties = [ |
||
| 8 | 'id', |
||
| 9 | 'label', |
||
| 10 | 'organizationId', |
||
| 11 | 'organization', |
||
| 12 | ]; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * String representation of {@link Post} |
||
| 16 | * |
||
| 17 | * @return string |
||
| 18 | */ |
||
| 19 | 3 | public function __toString() |
|
| 23 | |||
| 24 | 21 | protected function getId() |
|
| 28 | |||
| 29 | 6 | protected function getLabel() |
|
| 33 | |||
| 34 | 6 | protected function getOrganizationId() |
|
| 38 | |||
| 39 | 3 | protected function getOrganization() |
|
| 43 | } |
||
| 44 |
Since your code implements the magic getter
_get, this function will be called for any read access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.