| 1 | <?php |
||
| 8 | class ConfigurablePageFieldExtension extends DataExtension |
||
| 9 | { |
||
| 10 | private static $belongs_many_many = [ |
||
| 11 | 'Parents' => 'ConfigurablePage', |
||
| 12 | ]; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Get field value that is suitable for the view template file. |
||
| 16 | * |
||
| 17 | * @return object|false|string |
||
| 18 | */ |
||
| 19 | public function getViewValue() |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Get string value of a field. |
||
| 34 | * |
||
| 35 | * @return null|string |
||
| 36 | */ |
||
| 37 | public function getValueAsString() |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Format the field Title to be suitable as a variable in template. |
||
| 44 | * |
||
| 45 | * @return string |
||
| 46 | */ |
||
| 47 | public function getViewFieldName() |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Editable field can only be changed if is not part of a group. |
||
| 54 | * |
||
| 55 | * @param null $member |
||
| 56 | * |
||
| 57 | * @return bool |
||
| 58 | */ |
||
| 59 | public function canEdit($member = null) |
||
| 63 | } |
||
| 64 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.jsonfile (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.jsonto be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
requireorrequire-devsection?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceofchecks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.