eZ\Publish\Core\Persistence\Legacy\User\Role\Gateway::deleteRole PHP Method

deleteRole() abstract public method

If it's not a draft, the role assignments will also be deleted.
abstract public deleteRole ( mixed $roleId, integer $status = Role::STATUS_DEFINED )
$roleId mixed
$status integer One of Role::STATUS_DEFINED|Role::STATUS_DRAFT
    public abstract function deleteRole($roleId, $status = Role::STATUS_DEFINED);

Usage Example

Example #1
0
 /**
  * Delete the specified role (draft).
  *
  * @param mixed $roleId
  * @param int $status One of Role::STATUS_DEFINED|Role::STATUS_DRAFT
  */
 public function deleteRole($roleId, $status = Role::STATUS_DEFINED)
 {
     $role = $this->loadRole($roleId, $status);
     foreach ($role->policies as $policy) {
         $this->roleGateway->removePolicy($policy->id);
     }
     $this->roleGateway->deleteRole($role->id, $status);
 }
All Usage Examples Of eZ\Publish\Core\Persistence\Legacy\User\Role\Gateway::deleteRole