| @@ 197-207 (lines=11) @@ | ||
| 194 | * |
|
| 195 | * @return bool |
|
| 196 | */ |
|
| 197 | protected function isMemberOf($member, $relation) {
|
|
| 198 | if(!$member || !$member->exists()) {
|
|
| 199 | return false; |
|
| 200 | } |
|
| 201 | ||
| 202 | if($relation instanceof UnsavedRelationList) {
|
|
| 203 | return in_array($member->ID, $relation->getIDList()); |
|
| 204 | } |
|
| 205 | ||
| 206 | return $relation->byID($member->ID) !== null; |
|
| 207 | } |
|
| 208 | ||
| 209 | /** |
|
| 210 | * Determine the role of the given member. |
|
| @@ 152-164 (lines=13) @@ | ||
| 149 | * |
|
| 150 | * @return bool |
|
| 151 | */ |
|
| 152 | public function isAuthor($member = null) {
|
|
| 153 | if(!$member || !$member->exists()) {
|
|
| 154 | return false; |
|
| 155 | } |
|
| 156 | ||
| 157 | $list = $this->Authors(); |
|
| 158 | ||
| 159 | if($list instanceof UnsavedRelationList) {
|
|
| 160 | return in_array($member->ID, $list->getIDList()); |
|
| 161 | } |
|
| 162 | ||
| 163 | return $list->byID($member->ID) !== null; |
|
| 164 | } |
|
| 165 | ||
| 166 | /** |
|
| 167 | * {@inheritdoc}
|
|