1 | <?php |
||
25 | class Activity extends Model |
||
26 | { |
||
27 | use RelationTrait; |
||
28 | |||
29 | /** |
||
30 | * Timestamp enabled. |
||
31 | * |
||
32 | * @var bool |
||
33 | */ |
||
34 | public $timestamps = true; |
||
35 | |||
36 | /** |
||
37 | * Name of database table. |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | protected $table = 'users_activity'; |
||
42 | |||
43 | /** |
||
44 | * List of allowed columns to be used in $this->fill(). |
||
45 | * |
||
46 | * @var array |
||
47 | */ |
||
48 | protected $fillable = ['type_id', 'parent_id', 'user_id', 'item_id', 'action_id', 'data']; |
||
49 | |||
50 | /** |
||
51 | * List of columns and their cast data-type. |
||
52 | * |
||
53 | * @var array |
||
54 | */ |
||
55 | protected $casts = [ |
||
56 | 'data' => 'array', |
||
57 | ]; |
||
58 | |||
59 | /** |
||
60 | * Get a value from the data field using "dot" notation. |
||
61 | * |
||
62 | * @param string $name |
||
63 | * |
||
64 | * @return Collection |
||
65 | */ |
||
66 | 1 | public function dataCollection($name) |
|
70 | |||
71 | /* |
||
72 | * Get a value from the data field using "dot" notation. |
||
73 | * |
||
74 | * @param string $name |
||
75 | * |
||
76 | * @return mixed |
||
77 | */ |
||
78 | 1 | public function dataValue($name) |
|
82 | } |
||
83 |
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@property
annotation 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.