1 | <?php |
||
39 | class User extends Model implements AuthenticatableContract, CanResetPasswordContract |
||
40 | { |
||
41 | use Authenticatable, |
||
42 | CanResetPassword, |
||
43 | Traits\User\CountTrait, |
||
44 | Traits\User\RelationTrait, |
||
45 | Traits\User\CrudTrait, |
||
46 | Traits\User\QueryTrait; |
||
47 | |||
48 | /** |
||
49 | * User name is private. |
||
50 | * |
||
51 | * @var int |
||
52 | */ |
||
53 | const PRIVATE_YES = 1; |
||
54 | |||
55 | /** |
||
56 | * User name is public. |
||
57 | * |
||
58 | * @var int |
||
59 | */ |
||
60 | const PRIVATE_NO = 0; |
||
61 | |||
62 | /** |
||
63 | * User status Deleted. |
||
64 | * |
||
65 | * @var int |
||
66 | */ |
||
67 | const DELETED_USERS = 1; |
||
68 | |||
69 | /** |
||
70 | * User status not deleted. |
||
71 | * |
||
72 | * @var int |
||
73 | */ |
||
74 | const NOT_DELETED_USERS = 0; |
||
75 | |||
76 | /** |
||
77 | * User status active. (Standard). |
||
78 | * |
||
79 | * @var int |
||
80 | */ |
||
81 | const ACTIVE_USER = 1; |
||
82 | |||
83 | /** |
||
84 | * User status blocked. (Too many login attempts). |
||
85 | * |
||
86 | * @var int |
||
87 | */ |
||
88 | const BLOCKED_USER = 2; |
||
89 | |||
90 | /** |
||
91 | * User status inactive. (Cannot login at the moment). |
||
92 | * |
||
93 | * @var int |
||
94 | */ |
||
95 | const INACTIVE_USER = 0; |
||
96 | |||
97 | /** |
||
98 | * The database table used by the model. |
||
99 | * |
||
100 | * @var string |
||
101 | */ |
||
102 | protected $table = 'users'; |
||
103 | |||
104 | /** |
||
105 | * The attributes that are mass assignable. |
||
106 | * |
||
107 | * @var array |
||
108 | */ |
||
109 | protected $fillable = ['deleted', 'email', 'password', 'firstname', 'lastname', 'role_id', 'private', 'language', 'status']; |
||
110 | |||
111 | /** |
||
112 | * The attributes excluded from the model's JSON form. |
||
113 | * |
||
114 | * @var array |
||
115 | */ |
||
116 | protected $hidden = ['password', 'remember_token']; |
||
117 | |||
118 | /** |
||
119 | * Collection of user permissions. |
||
120 | * |
||
121 | * @var Eloquent\Collection |
||
122 | */ |
||
123 | protected $permission; |
||
124 | |||
125 | /** |
||
126 | * Get available languages from translations folder. |
||
127 | * |
||
128 | * @return array |
||
129 | */ |
||
130 | 3 | public static function getLanguages() |
|
143 | |||
144 | /** |
||
145 | * Checks to see if $this user is current user. |
||
146 | * |
||
147 | * @return bool |
||
148 | */ |
||
149 | 3 | public function me() |
|
153 | |||
154 | /** |
||
155 | * Whether or not the user has a valid permission in current context |
||
156 | * e.g. can access the issue or the project. |
||
157 | * |
||
158 | * @param array $params |
||
159 | * |
||
160 | * @return bool |
||
161 | */ |
||
162 | 39 | public function permissionInContext(array $params) |
|
185 | |||
186 | /** |
||
187 | * Whether or not the user has a permission. |
||
188 | * |
||
189 | * @param string $key |
||
190 | * |
||
191 | * @return bool |
||
192 | */ |
||
193 | 54 | public function permission($key) |
|
204 | |||
205 | /** |
||
206 | * Return user full name with property "fullname". |
||
207 | * |
||
208 | * @return string |
||
209 | */ |
||
210 | 39 | public function getFullNameAttribute() |
|
218 | |||
219 | /** |
||
220 | * Return user image. |
||
221 | * |
||
222 | * @return string |
||
223 | */ |
||
224 | public function getImageAttribute() |
||
228 | |||
229 | /** |
||
230 | * Returns list of user statuses |
||
231 | * |
||
232 | * @return array |
||
233 | */ |
||
234 | 2 | public static function getStatuses() |
|
242 | |||
243 | /** |
||
244 | * Whether or not the user is active. |
||
245 | * |
||
246 | * @return bool |
||
247 | */ |
||
248 | 7 | public function isActive() |
|
252 | |||
253 | /** |
||
254 | * Whether or not the user is inactive. |
||
255 | * |
||
256 | * @return bool |
||
257 | */ |
||
258 | public function isInactive() |
||
262 | |||
263 | /** |
||
264 | * Whether or not the user is blocked. |
||
265 | * |
||
266 | * @return bool |
||
267 | */ |
||
268 | public function isBlocked() |
||
272 | } |
||
273 |
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.