public function delete() { $mb = $this->model->getBackend(); $auth = new Moonlake_Auth_AuthModel($mb); $cond = new Moonlake_Model_Condition(); $cond->is('role', $this->roleid); $auth->deleteEntriesByCondition($cond); $roluser = new Moonlake_Auth_UsersRolesModel($mb); $roluser->deleteEntriesByCondition($cond); $this->model->deleteEntry($this->roleid); }
public function deleteRole(Moonlake_Auth_Role $role) { $mb = $this->model->getBackend(); $model = new Moonlake_Auth_UsersRolesModel($mb); $cond = new Moonlake_Model_Condition(); $cond->is('user', $this->userid); $cond->is('role', $role->getId()); $model->deleteEntriesByCondition($cond); }