@@ 251-262 (lines=12) @@ | ||
248 | * |
|
249 | * @return bool |
|
250 | */ |
|
251 | protected function isMemberOf($member, $relation) |
|
252 | { |
|
253 | if (!$member || !$member->exists()) { |
|
254 | return false; |
|
255 | } |
|
256 | ||
257 | if ($relation instanceof UnsavedRelationList) { |
|
258 | return in_array($member->ID, $relation->getIDList()); |
|
259 | } |
|
260 | ||
261 | return $relation->byID($member->ID) !== null; |
|
262 | } |
|
263 | ||
264 | /** |
|
265 | * Determine the role of the given member. |
@@ 197-210 (lines=14) @@ | ||
194 | * |
|
195 | * @return bool |
|
196 | */ |
|
197 | public function isAuthor($member = null) |
|
198 | { |
|
199 | if (!$member || !$member->exists()) { |
|
200 | return false; |
|
201 | } |
|
202 | ||
203 | $list = $this->Authors(); |
|
204 | ||
205 | if ($list instanceof UnsavedRelationList) { |
|
206 | return in_array($member->ID, $list->getIDList()); |
|
207 | } |
|
208 | ||
209 | return $list->byID($member->ID) !== null; |
|
210 | } |
|
211 | ||
212 | /** |
|
213 | * {@inheritdoc} |