| @@ 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. |
|
| @@ 194-207 (lines=14) @@ | ||
| 191 | * |
|
| 192 | * @return bool |
|
| 193 | */ |
|
| 194 | public function isAuthor($member = null) |
|
| 195 | { |
|
| 196 | if (!$member || !$member->exists()) { |
|
| 197 | return false; |
|
| 198 | } |
|
| 199 | ||
| 200 | $list = $this->Authors(); |
|
| 201 | ||
| 202 | if ($list instanceof UnsavedRelationList) { |
|
| 203 | return in_array($member->ID, $list->getIDList()); |
|
| 204 | } |
|
| 205 | ||
| 206 | return $list->byID($member->ID) !== null; |
|
| 207 | } |
|
| 208 | ||
| 209 | /** |
|
| 210 | * {@inheritdoc} |
|