1 | <?php |
||
16 | class Advert extends Model |
||
17 | { |
||
18 | |||
19 | const STATUS_OPEN = 1; // 可用状态 |
||
20 | |||
21 | const STATUS_CLOSE = 0; // 关闭状态 |
||
22 | |||
23 | protected $guarded = ['id']; |
||
24 | |||
25 | /** |
||
26 | * Address constructor. |
||
27 | * |
||
28 | * @param array $attributes |
||
29 | */ |
||
30 | 4 | public function __construct(array $attributes = []) |
|
37 | |||
38 | 1 | public function addAdvertItem(array $attributes = []){ |
|
45 | |||
46 | |||
47 | } |
||
48 |
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.