| 1 | <?php |
||
| 10 | class ViewTemplate extends DataObject |
||
| 11 | { |
||
| 12 | private static $db = [ |
||
| 13 | 'Title' => 'Varchar(127)', |
||
| 14 | 'ViewTemplate' => 'Text', |
||
| 15 | ]; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Human-readable singular name. |
||
| 19 | * |
||
| 20 | * @var string |
||
| 21 | * @config |
||
| 22 | */ |
||
| 23 | private static $singular_name = 'View Template'; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Human-readable plural name. |
||
| 27 | * |
||
| 28 | * @var string |
||
| 29 | * @config |
||
| 30 | */ |
||
| 31 | private static $plural_name = 'View Templates'; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Return template placeholder. |
||
| 35 | * |
||
| 36 | * @return string |
||
| 37 | */ |
||
| 38 | 2 | public function getPlaceHolder() |
|
| 42 | } |
||
| 43 |
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.