/** * @param array $formData * * @return \Generated\Shared\Transfer\RolesTransfer */ protected function getRoleTransfersFromForm(array $formData) { $roles = new RolesTransfer(); foreach ($formData[GroupForm::FIELD_ROLES] as $idRole) { $roleTransfer = (new RoleTransfer())->setIdAclRole($idRole); $roles->addRole($roleTransfer); } return $roles; }
/** * @param int $idRole * * @return \Generated\Shared\Transfer\RulesTransfer */ public function getRoleRules($idRole) { $roleTransfer = new RoleTransfer(); $roleTransfer->setIdAclRole($idRole); $rolesTransfer = new RolesTransfer(); $rolesTransfer->addRole($roleTransfer); $rules = $this->findByRoles($rolesTransfer); return $rules; }
/** * @param int $idGroup * * @return \Generated\Shared\Transfer\RoleTransfer */ public function getRoles($idGroup) { $roleCollection = $this->queryContainer->queryGroupRoles($idGroup)->find(); $roleTransferCollection = new RolesTransfer(); foreach ($roleCollection as $roleEntity) { $roleTransfer = new RoleTransfer(); $roleTransfer->fromArray($roleEntity->toArray(), true); $roleTransferCollection->addRole($roleTransfer); } return $roleTransferCollection; }
/** * @param int $idGroup * * @return \Generated\Shared\Transfer\RolesTransfer */ public function getGroupRoles($idGroup) { $aclRoleEntities = $this->queryContainer->queryGroupRoles($idGroup)->find(); $rolesTransfer = new RolesTransfer(); foreach ($aclRoleEntities as $aclRoleEntity) { $roleTransfer = new RoleTransfer(); $roleTransfer->fromArray($aclRoleEntity->toArray(), true); $rolesTransfer->addRole($roleTransfer); } return $rolesTransfer; }