plugin/competency/Repository/CompetencyRepository.php
public function findFirstGroupsByName($search)
    {
        return $this->_em->createQueryBuilder()
            ->select('g.id, g.name')
            ->from('ClarolineCoreBundle:Group', 'g')
            ->where('g.name LIKE :search')
            ->setMaxResults(5)
            ->setParameter(':search', "%{$search}%")
            ->getQuery()
            ->getArrayResult();
    }
public function findFirstGroupsByName($search)
    {
        return $this->_em->createQueryBuilder()
            ->select('g.id, g.name')
            ->from('ClarolineCoreBundle:Group', 'g')
            ->where('g.name LIKE :search')
            ->setMaxResults(5)
            ->setParameter(':search', "%{$search}%")
            ->getQuery()
            ->getArrayResult();
    }
public function findFirstGroupsByName ( $ search ) { return $ this -> _em -> createQueryBuilder ( ) -> select ( 'g.id, g.name' ) -> from ( 'ClarolineCoreBundle:Group' , 'g' ) -> where ( 'g.name LIKE :search' ) -> setMaxResults ( 5 ) -> setParameter ( ':search' , "%{$search}%" ) -> getQuery ( ) -> getArrayResult ( ) ; }
Returns the first five users whose name includes a given string.

Note: this should definitely not be here

@param string $search

@return array
Returns the first five users whose name includes a given string .