@@ 220-233 (lines=14) @@ | ||
217 | * |
|
218 | * @return bool |
|
219 | */ |
|
220 | public function isAuthor($member = null) |
|
221 | { |
|
222 | if (!$member || !$member->exists()) { |
|
223 | return false; |
|
224 | } |
|
225 | ||
226 | $list = $this->Authors(); |
|
227 | ||
228 | if ($list instanceof UnsavedRelationList) { |
|
229 | return in_array($member->ID, $list->getIDList()); |
|
230 | } |
|
231 | ||
232 | return $list->byID($member->ID) !== null; |
|
233 | } |
|
234 | ||
235 | /** |
|
236 | * {@inheritdoc} |
@@ 295-306 (lines=12) @@ | ||
292 | * |
|
293 | * @return bool |
|
294 | */ |
|
295 | protected function isMemberOf($member, $relation) |
|
296 | { |
|
297 | if (!$member || !$member->exists()) { |
|
298 | return false; |
|
299 | } |
|
300 | ||
301 | if ($relation instanceof UnsavedRelationList) { |
|
302 | return in_array($member->ID, $relation->getIDList()); |
|
303 | } |
|
304 | ||
305 | return $relation->byID($member->ID) !== null; |
|
306 | } |
|
307 | ||
308 | /** |
|
309 | * Determine the role of the given member. |