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