//Set the request
$req = <<<SQL
SELECT COUNT(u.id) AS count
-FROM RapsysUserBundle:User AS u
+FROM Rapsys\UserBundle\Entity\User AS u
SQL;
//Get result set mapping instance
u.mail,
u.forename,
u.surname,
- IFNULL(g.id, 0) AS g_id,
- IFNULL(g.title, :defaultgroup) AS g_title
- FROM RapsysUserBundle:User AS u
- LEFT JOIN RapsysUserBundle:UserGroup AS gu ON (gu.user_id = u.id)
- LEFT JOIN RapsysUserBundle:Group AS g ON (g.id = gu.group_id)
+ g.id AS g_id,
+ g.title AS g_title
+ FROM Rapsys\UserBundle\Entity\User AS u
+ LEFT JOIN Rapsys\UserBundle\Entity\UserGroup AS gu ON (gu.user_id = u.id)
+ LEFT JOIN Rapsys\UserBundle\Entity\Group AS g ON (g.id = gu.group_id)
ORDER BY NULL
LIMIT 0, :limit
) AS t
//Process result
foreach($res as $data) {
//Get translated group
- $group = $this->translator->trans($data['g_title'], [], $this->alias);
+ $group = $this->translator->trans($data['g_title']?:'Null', [], $this->alias);
//Init group subarray
if (!isset($ret[$group])) {