| 1 | <?php |
||
| 9 | class SilverStripeVersion extends DataObject |
||
| 10 | { |
||
| 11 | public static $db = array( |
||
| 12 | 'Name' => 'Varchar(10)', |
||
| 13 | 'Major' => 'Int', |
||
| 14 | 'Minor' => 'Int' |
||
| 15 | ); |
||
| 16 | |||
| 17 | public static $default_sort = array( |
||
| 18 | 'Major' => 'DESC', |
||
| 19 | 'Minor' => 'DESC' |
||
| 20 | ); |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Returns a generic version contraint for this version |
||
| 24 | * |
||
| 25 | * @return string |
||
| 26 | */ |
||
| 27 | public function __toString() |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Check whether a given module's composer version constraint will apply to this version |
||
| 34 | * |
||
| 35 | * @param string|ConstraintInterface $constraint |
||
| 36 | * @return bool |
||
| 37 | */ |
||
| 38 | public function getConstraintValidity($constraint) |
||
| 45 | } |
||
| 46 |
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.