public function setRole(Model\CMS\Entity\Role $role) { if (!$role->canBeDeleted()) { throw new Model\CMS\ProtectedRoleException('This role cannot be removed.'); } $this->role = $role; return $this; }