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