1 | <?php |
||
17 | class AdvertItem extends Model |
||
18 | { |
||
19 | use NodeTrait; |
||
20 | |||
21 | const STATUS_OPEN = 1; // 可用状态 |
||
22 | |||
23 | const STATUS_CLOSE = 0; // 关闭状态 |
||
24 | |||
25 | protected $guarded = ['id']; |
||
26 | |||
27 | /** |
||
28 | * Address constructor. |
||
29 | * |
||
30 | * @param array $attributes |
||
31 | */ |
||
32 | 4 | public function __construct(array $attributes = []) |
|
38 | |||
39 | 3 | public function advert() |
|
43 | |||
44 | 3 | public function associate() |
|
48 | |||
49 | 1 | public function addChildren(array $attributes = []){ |
|
58 | |||
59 | } |
||
60 |
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@property
annotation 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.