public function acceptInvitation(Invitation $invitation)
 {
     $role = $this->getRole($invitation->getRole());
     $note = $invitation->getNote();
     $item = Area::fetchActive($this->conn, $invitation->getResourceId());
     $item->joinMember($this->conn, $invitation->getUser(), $role, $note);
 }
Example #2
0
 public function revoke($id, User $user)
 {
     $this->transaction->requestTransaction();
     try {
         $item = Invitation::fetchByUser($this->conn, $id, $user);
         if (empty($item)) {
             throw new ItemNotFoundException('The specified invitation cannot be found.');
         }
         $item->remove($this->conn);
     } catch (Exception $exception) {
         $this->transaction->requestRollback();
         throw $exception;
     }
 }