private function roleTypeHandle(AclRule $e) { if ($e === null) { throw new Exceptions\NullPointerException("Argument Event cannot be null", 0); } try { $role = null; $id = $this->getMixId($e->getRole()); if ($id !== null) { $role = $this->roleService->getRole($id, false); } $e->setRole($role); } catch (\Exception $e) { throw new Exceptions\DataErrorException($e->getMessage(), $e->getCode(), $e->getPrevious()); } }
private function posRoleTypeHandle(Position $p) { if ($p === null) { throw new Exceptions\NullPointerException("Argument Position cannot be null"); } try { $role = null; $id = $this->getMixId($p->getRole()); if ($id !== null) { $role = $this->roleService->getRole($id, false); } $p->setRole($role); } catch (\Exception $e) { $this->logError($e); throw new Exceptions\DataErrorException($e->getMessage(), $e->getCode(), $e->getPrevious()); } }
/** * Presenter action for role update page * @Secured(resource="updateRole") * @param integer $id */ public function actionUpdateRole($id) { if (!$id) { $this->handleBadArgument($id); } try { $dbRole = $this->roleService->getRole((int) $id); if ($dbRole !== null) { $form = $this->getComponent('updateRoleForm'); $dbRole->setParents($dbRole->getParents()->map(function (Role $e) { return $e->getId(); })->toArray()); $form->setDefaults($dbRole->toArray()); } else { $this->handleEntityNotExists($id); } } catch (Exceptions\DataErrorException $ex) { $this->handleDataLoad($id, "default", $ex); } }