| 1 | <?php |
||
| 9 | class Menuitem extends Model |
||
| 10 | { |
||
| 11 | use Translatable, NestableTrait; |
||
| 12 | |||
| 13 | public $translatedAttributes = ['title', 'uri', 'url', 'status', 'locale']; |
||
| 14 | protected $fillable = [ |
||
| 15 | 'menu_id', |
||
| 16 | 'page_id', |
||
| 17 | 'parent_id', |
||
| 18 | 'position', |
||
| 19 | 'target', |
||
| 20 | 'module_name', |
||
| 21 | 'title', |
||
| 22 | 'uri', |
||
| 23 | 'url', |
||
| 24 | 'status', |
||
| 25 | 'is_root', |
||
| 26 | 'icon', |
||
| 27 | 'link_type', |
||
| 28 | 'locale', |
||
| 29 | 'class', |
||
| 30 | ]; |
||
| 31 | protected $table = 'menu__menuitems'; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * For nested collection |
||
| 35 | * |
||
| 36 | * @var array |
||
| 37 | */ |
||
| 38 | public $children = []; |
||
| 39 | |||
| 40 | public function menu() |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Make the current menu item child of the given root item |
||
| 47 | * @param Menuitem $rootItem |
||
| 48 | */ |
||
| 49 | public function makeChildOf(Menuitem $rootItem) |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Check if the current menu item is the root |
||
| 57 | * @return bool |
||
| 58 | */ |
||
| 59 | public function isRoot() |
||
| 63 | |||
| 64 | /** |
||
| 65 | * Check if page_id is empty and returning null instead empty string |
||
| 66 | * @return number |
||
| 67 | */ |
||
| 68 | public function setPageIdAttribute($value) |
||
| 72 | |||
| 73 | /** |
||
| 74 | * Check if parent_id is empty and returning null instead empty string |
||
| 75 | * @return number |
||
| 76 | */ |
||
| 77 | public function setParentIdAttribute($value) |
||
| 81 | } |
||
| 82 |
Since your code implements the magic setter
_set, this function will be called for any write access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write 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.