]> Raphaël G. Git Repositories - airbundle/commitdiff
Cleanup findAllApplicantBySession
authorRaphaël Gertz <git@rapsys.eu>
Wed, 9 Dec 2020 20:42:43 +0000 (21:42 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Wed, 9 Dec 2020 20:42:43 +0000 (21:42 +0100)
Repository/UserRepository.php

index 8b490c47abf4f19135959b157c432312f602cb14..9f112ee10e322ba2656ea393ad83bd0956ba809d 100644 (file)
@@ -102,22 +102,22 @@ class UserRepository extends \Doctrine\ORM\EntityRepository {
        }
 
        /**
        }
 
        /**
-        * Find all user's pseudonym from session applications
+        * Find all applicant by session
         *
         *
-        * @param $session The Session instance
+        * @param $session The Session
         */
         */
-       public function findAllPseudonymBySession($session) {
+       public function findAllApplicantBySession($session) {
                //Get entity manager
                $em = $this->getEntityManager();
 
                //Fetch sessions
                $ret = $this->getEntityManager()
                //Get entity manager
                $em = $this->getEntityManager();
 
                //Fetch sessions
                $ret = $this->getEntityManager()
-                       ->createQuery('SELECT u.id, u.pseudonym FROM RapsysAirBundle:Application a INNER JOIN RapsysAirBundle:User u WHERE u.id = a.user AND a.session = :session')
+                       ->createQuery('SELECT u.id, u.pseudonym FROM RapsysAirBundle:Application a JOIN RapsysAirBundle:User u WITH u.id = a.user WHERE a.session = :session')
                        ->setParameter('session', $session)
                        ->getResult();
 
                //Process result
                        ->setParameter('session', $session)
                        ->getResult();
 
                //Process result
-               $ret = array_column($ret, 'pseudonym', 'id');
+               $ret = array_column($ret, 'id', 'pseudonym');
 
                //Send result
                return $ret;
 
                //Send result
                return $ret;