Loading module/Application/src/Application/Controller/ProfilController.php +2 −1 Changes for module/Application/src/Application/Controller/ProfilController.php: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -108,7 +108,7 @@ class ProfilController extends AbstractActionController { $profilId = $this->params()->fromRoute('profil'); $profil = $this->getProfilService()->getProfil($profilId); $roles = $this->getRoleService()->getRoles(); $roles = $this->getRoleService()->getRolesSansProfil(); return new ViewModel([ 'profil' => $profil, Loading @@ -133,6 +133,7 @@ class ProfilController extends AbstractActionController { if (! $profil->hasRole($role)) { $profil->addRole($role); $this->getProfilService()->update($profil); // $this->getProfilService()->applyProfilToRole($profil, $role); } } Loading module/Application/src/Application/Service/Role/RoleService.php +15 −0 Changes for module/Application/src/Application/Service/Role/RoleService.php: 15 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -308,6 +308,21 @@ class RoleService extends BaseService return $result; } /** * @return Role[] */ public function getRolesSansProfil() { $qb = $this->getEntityManager()->getRepository(Role::class)->createQueryBuilder('role') ->leftJoin('role.profils', 'profil') ->andWhere('profil.id IS NULL') ->orderBy('role.roleId', 'ASC') ; $roles = $qb->getQuery()->getResult(); return $roles; } //SELECT * FROM ROLE R //JOIN STRUCTURE S on R.STRUCTURE_ID = S.ID //LEFT JOIN STRUCTURE_SUBSTIT SS on S.ID = SS.FROM_STRUCTURE_ID Loading Loading
module/Application/src/Application/Controller/ProfilController.php +2 −1 Changes for module/Application/src/Application/Controller/ProfilController.php: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -108,7 +108,7 @@ class ProfilController extends AbstractActionController { $profilId = $this->params()->fromRoute('profil'); $profil = $this->getProfilService()->getProfil($profilId); $roles = $this->getRoleService()->getRoles(); $roles = $this->getRoleService()->getRolesSansProfil(); return new ViewModel([ 'profil' => $profil, Loading @@ -133,6 +133,7 @@ class ProfilController extends AbstractActionController { if (! $profil->hasRole($role)) { $profil->addRole($role); $this->getProfilService()->update($profil); // $this->getProfilService()->applyProfilToRole($profil, $role); } } Loading
module/Application/src/Application/Service/Role/RoleService.php +15 −0 Changes for module/Application/src/Application/Service/Role/RoleService.php: 15 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -308,6 +308,21 @@ class RoleService extends BaseService return $result; } /** * @return Role[] */ public function getRolesSansProfil() { $qb = $this->getEntityManager()->getRepository(Role::class)->createQueryBuilder('role') ->leftJoin('role.profils', 'profil') ->andWhere('profil.id IS NULL') ->orderBy('role.roleId', 'ASC') ; $roles = $qb->getQuery()->getResult(); return $roles; } //SELECT * FROM ROLE R //JOIN STRUCTURE S on R.STRUCTURE_ID = S.ID //LEFT JOIN STRUCTURE_SUBSTIT SS on S.ID = SS.FROM_STRUCTURE_ID Loading