1 | <?php |
||
35 | class Moment extends Model implements HasPresenter |
||
36 | { |
||
37 | const CREATED = 1; |
||
38 | const UPDATED = 2; |
||
39 | const CLOSED = 3; |
||
40 | const REOPENED = 4; |
||
41 | const PUSHED = 5; |
||
42 | const COMMENTED = 6; |
||
43 | const MERGED = 7; |
||
44 | const JOINED = 8; # User joined project |
||
45 | const LEFT = 9; # User left project |
||
46 | const DESTROYED = 10; |
||
47 | |||
48 | /** |
||
49 | * The attributes that should be casted to native types. |
||
50 | * |
||
51 | * @var string[] |
||
52 | */ |
||
53 | protected $casts = [ |
||
54 | 'id' => 'int', |
||
55 | 'deleted_at' => 'date', |
||
56 | ]; |
||
57 | |||
58 | /** |
||
59 | * The fillable properties. |
||
60 | * |
||
61 | * @var string[] |
||
62 | */ |
||
63 | protected $fillable = [ |
||
64 | 'target_type', |
||
65 | 'target_id', |
||
66 | 'action', |
||
67 | 'author_id', |
||
68 | 'project_id', |
||
69 | 'title', |
||
70 | 'data', |
||
71 | 'created_at', |
||
72 | 'updated_at', |
||
73 | ]; |
||
74 | |||
75 | /** |
||
76 | * The validation rules. |
||
77 | * |
||
78 | * @var string[] |
||
79 | */ |
||
80 | public $rules = [ |
||
81 | 'target_type' => 'string', |
||
82 | 'target_id' => 'int', |
||
83 | 'action' => 'int', |
||
84 | 'author_id' => 'int', |
||
85 | 'project_id' => 'int', |
||
86 | 'title' => 'string', |
||
87 | 'data' => 'string', |
||
88 | ]; |
||
89 | |||
90 | /** |
||
91 | * Finds all rencent moments. |
||
92 | * |
||
93 | * @param \Illuminate\Database\Eloquent\Builder $query |
||
94 | * |
||
95 | * @return \Illuminate\Database\Eloquent\Builder |
||
96 | */ |
||
97 | public function scopeRecent(Builder $query) |
||
101 | |||
102 | /** |
||
103 | * Finds all code push moments. |
||
104 | * |
||
105 | * @param \Illuminate\Database\Eloquent\Builder $query |
||
106 | * |
||
107 | * @return \Illuminate\Database\Eloquent\Builder |
||
108 | */ |
||
109 | public function scopeCodePush(Builder $query) |
||
113 | |||
114 | /** |
||
115 | * A moment belongs to a project. |
||
116 | * |
||
117 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
118 | */ |
||
119 | public function project() |
||
123 | |||
124 | /** |
||
125 | * Moments can belong to an author. |
||
126 | * |
||
127 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
128 | */ |
||
129 | public function author() |
||
133 | |||
134 | /** |
||
135 | * Moments can belong to a target. |
||
136 | * |
||
137 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
138 | */ |
||
139 | public function target() |
||
143 | |||
144 | /** |
||
145 | * Get the presenter class. |
||
146 | * |
||
147 | * @return string |
||
148 | */ |
||
149 | public function getPresenterClass() |
||
153 | } |
||
154 |
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.