public function acceptInvitation(Invitation $invitation) { $role = $this->getRole($invitation->getRole()); $note = $invitation->getNote(); $item = Group::fetch($this->conn, $invitation->getResourceId()); $item->joinMember($this->conn, $invitation->getUser(), $role, $note); }