1 | <?php |
||
42 | class Employee extends Model implements AuthenticatableContract, |
||
43 | AuthorizableContract, |
||
44 | CanResetPasswordContract, |
||
45 | PolicyCheckable |
||
46 | { |
||
47 | use Authenticatable, Authorizable, CanResetPassword; |
||
48 | |||
49 | /** |
||
50 | * The attributes that are mass assignable. |
||
51 | * |
||
52 | * @var array |
||
53 | */ |
||
54 | protected $fillable = ['name', 'email', 'password']; |
||
55 | |||
56 | /** |
||
57 | * The attributes excluded from the model's JSON form. |
||
58 | * |
||
59 | * @var array |
||
60 | */ |
||
61 | protected $hidden = ['password', 'remember_token', 'pivot']; |
||
62 | |||
63 | /** |
||
64 | * @var array |
||
65 | */ |
||
66 | protected $appends = ['is_planner']; |
||
67 | |||
68 | 23 | public function getIsPlannerAttribute() |
|
72 | |||
73 | /** |
||
74 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
75 | */ |
||
76 | 2 | public function company() |
|
80 | |||
81 | /** |
||
82 | * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany |
||
83 | */ |
||
84 | 76 | public function groups() |
|
88 | |||
89 | /** |
||
90 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
91 | */ |
||
92 | 32 | public function calendars() |
|
96 | |||
97 | /** |
||
98 | * meetings where the user participates |
||
99 | * to get all meetings where the user can go user groups with meetings |
||
100 | * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany |
||
101 | */ |
||
102 | 10 | public function meetings(){ |
|
106 | |||
107 | /** |
||
108 | * Get the e-mail address where password reset links are sent. |
||
109 | * This is needed for multiple user type login |
||
110 | * |
||
111 | * Make email unique |
||
112 | * |
||
113 | * @return string |
||
114 | */ |
||
115 | 2 | public function getEmailForPasswordReset() |
|
129 | |||
130 | /** |
||
131 | * @param Group $group |
||
132 | * @return bool |
||
133 | */ |
||
134 | 8 | public function belongsToGroup(Group $group) |
|
139 | |||
140 | /* |
||
141 | * for a normal employee the policyCheckable methods say if the employee can se or not the element |
||
142 | */ |
||
143 | |||
144 | /** |
||
145 | * @param Group $group |
||
146 | * @return bool |
||
147 | */ |
||
148 | 4 | public function verifyGroup(Group $group) |
|
152 | |||
153 | /** |
||
154 | * @param Employee $employee |
||
155 | * @return bool |
||
156 | */ |
||
157 | public function verifyEmployee(Employee $employee) |
||
161 | |||
162 | /** |
||
163 | * @param Company $company |
||
164 | * @return bool |
||
165 | */ |
||
166 | public function verifyCompany(Company $company) |
||
170 | |||
171 | /** |
||
172 | * the employee can modify a calendar |
||
173 | * @param Calendar $calendar |
||
174 | * @return bool |
||
175 | */ |
||
176 | 22 | public function verifyCalendar(Calendar $calendar) |
|
181 | |||
182 | /** |
||
183 | * @param Timeslot $timeslot |
||
184 | * @return bool |
||
185 | */ |
||
186 | 8 | public function verifyTimeslot(Timeslot $timeslot) |
|
191 | |||
192 | /** |
||
193 | * @param Meeting $meeting |
||
194 | * @return bool |
||
195 | */ |
||
196 | 4 | public function verifyMeeting(Meeting $meeting) |
|
202 | |||
203 | /** |
||
204 | * @param MeetingTimeslot $meetingTimeslot |
||
205 | * @return bool |
||
206 | */ |
||
207 | public function verifyMeetingTimeslot(MeetingTimeslot $meetingTimeslot) |
||
212 | |||
213 | /** |
||
214 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
215 | */ |
||
216 | 61 | protected function groupsManagedRelationship() |
|
220 | } |
||
221 |
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.
If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.