protected function isMemberOf($member, $relation)
    {
        if (!$member || !$member->exists()) {
            return false;
        }

        if ($relation instanceof UnsavedRelationList) {
            return in_array($member->ID, $relation->getIDList());
        }

        return $relation->byID($member->ID) !== null;
    }
protected function isMemberOf($member, $relation)
    {
        if (!$member || !$member->exists()) {
            return false;
        }

        if ($relation instanceof UnsavedRelationList) {
            return in_array($member->ID, $relation->getIDList());
        }

        return $relation->byID($member->ID) !== null;
    }
protected function isMemberOf ( $ member , $ relation ) { if ( ! $ member || ! $ member -> exists ( ) ) { return false ; } if ( $ relation instanceof UnsavedRelationList ) { return in_array ( $ member -> ID , $ relation -> getIDList ( ) ) ; } return $ relation -> byID ( $ member -> ID ) !== null ; }
Determine if the given member belongs to the given relation.

@param Member $member
@param DataList $relation

@return bool
Determine if the given member belongs to the given relation .