private function createAttributesQuery(User $user)
    {
        $query = $this->getEntityManager()
            ->createQuery('
                SELECT ua
                FROM UserBundle:UserAttribute ua
                LEFT JOIN ua.groups ug
                INDEX BY ua.id
                WHERE ug.id IN (:groupIds)
            ')
        ->setParameters([
            ':groupIds' => $user->getGroupIds(),
        ]);

        return $query;
    }
private function createAttributesQuery(User $user)
    {
        $query = $this->getEntityManager()
            ->createQuery('
                SELECT ua
                FROM UserBundle:UserAttribute ua
                LEFT JOIN ua.groups ug
                INDEX BY ua.id
                WHERE ug.id IN (:groupIds)
            ')
        ->setParameters([
            ':groupIds' => $user->getGroupIds(),
        ]);

        return $query;
    }
private function createAttributesQuery ( User $ user ) { $ query = $ this -> getEntityManager ( ) -> createQuery ( '
                SELECT ua
                FROM UserBundle:UserAttribute ua
                LEFT JOIN ua.groups ug
                INDEX BY ua.id
                WHERE ug.id IN (:groupIds)
            ' ) -> setParameters ( [ ':groupIds' => $ user -> getGroupIds ( ) , ] ) ; return $ query ; }
Get list of user's attributes

@param User $user
@return \Doctrine\ORM\AbstractQuery
Get list of user s attributes