X-Git-Url: https://git.rapsys.eu/airbundle/blobdiff_plain/401c43f206e2952e9608ce83c2b8e897b438de6f..62564be28991a32bf3b72f334bd165da5bdb088d:/Repository/UserRepository.php?ds=sidebyside diff --git a/Repository/UserRepository.php b/Repository/UserRepository.php index e7ff076..985b3b2 100644 --- a/Repository/UserRepository.php +++ b/Repository/UserRepository.php @@ -151,17 +151,11 @@ class UserRepository extends \Doctrine\ORM\EntityRepository { //Set the request $req = <<addScalarResult('id', 'id', 'integer') + ->addScalarResult('mail', 'mail', 'string') ->addScalarResult('pseudonym', 'pseudonym', 'string') ->addScalarResult('g_id', 'g_id', 'integer') - ->addScalarResult('g_title', 'g_title', 'string') - ->addIndexByScalar('id'); + ->addScalarResult('g_title', 'g_title', 'string'); //Fetch result $res = $em @@ -191,7 +185,7 @@ SQL; //Process result foreach($res as $data) { //Get translated group - $group = $translator->trans($data['g_title']?:'User'); + $group = $translator->trans($data['g_title']); //Init group subarray if (!isset($ret[$group])) { @@ -199,7 +193,10 @@ SQL; } //Set data - $ret[$group][$data['id']] = $data['pseudonym']; + $ret[$group][$data['id']] = [ + 'mail' => $data['mail'], + 'pseudonym' => $data['pseudonym'] + ]; } //Send result