main/core/Repository/GroupRepository.php
public function findGroupsByWorkspacesAndSearch(array $workspaces, $search)
    {
        $upperSearch = strtoupper(trim($search));
        $dql = '
            SELECT g
            FROM Claroline\CoreBundle\Entity\Group g
            LEFT JOIN g.roles wr WITH wr IN (
                SELECT pr
                FROM Claroline\CoreBundle\Entity\Role pr
                WHERE pr.type = :type
            )
            LEFT JOIN wr.workspace w
            WHERE w IN (:workspaces)
            AND UPPER(g.name) LIKE :search
            ORDER BY g.name
       ';
        $query = $this->_em->createQuery($dql);
        $query->setParameter('workspaces', $workspaces);
        $query->setParameter('search', "%{$upperSearch}%");
        $query->setParameter('type', Role::WS_ROLE);

        return $query->getResult();
    }
public function findGroupsByWorkspacesAndSearch(array $workspaces, $search)
    {
        $upperSearch = strtoupper(trim($search));
        $dql = '
            SELECT g
            FROM Claroline\CoreBundle\Entity\Group g
            LEFT JOIN g.roles wr WITH wr IN (
                SELECT pr
                FROM Claroline\CoreBundle\Entity\Role pr
                WHERE pr.type = :type
            )
            LEFT JOIN wr.workspace w
            WHERE w IN (:workspaces)
            AND UPPER(g.name) LIKE :search
            ORDER BY g.name
       ';
        $query = $this->_em->createQuery($dql);
        $query->setParameter('workspaces', $workspaces);
        $query->setParameter('search', "%{$upperSearch}%");
        $query->setParameter('type', Role::WS_ROLE);

        return $query->getResult();
    }
public function findGroupsByWorkspacesAndSearch ( array $ workspaces , $ search ) { $ upperSearch = strtoupper ( trim ( $ search ) ) ; $ dql = '
            SELECT g
            FROM Claroline\CoreBundle\Entity\Group g
            LEFT JOIN g.roles wr WITH wr IN (
                SELECT pr
                FROM Claroline\CoreBundle\Entity\Role pr
                WHERE pr.type = :type
            )
            LEFT JOIN wr.workspace w
            WHERE w IN (:workspaces)
            AND UPPER(g.name) LIKE :search
            ORDER BY g.name
       ' ; $ query = $ this -> _em -> createQuery ( $ dql ) ; $ query -> setParameter ( 'workspaces' , $ workspaces ) ; $ query -> setParameter ( 'search' , "%{$upperSearch}%" ) ; $ query -> setParameter ( 'type' , Role :: WS_ROLE ) ; return $ query -> getResult ( ) ; }
Returns the groups which are member of a workspace
and whose name corresponds the search.

@param array  $workspace
@param string $search

@return array[Group]
Returns the groups which are member of a workspace and whose name corresponds the search .