public function findWithLetter($letter, $locale)
    {
        $query = $this->createQueryBuilder('g')
            ->addSelect('translation');
        if ($letter === '0') {
            $query
                ->innerJoin('g.translations', 'translation')
                ->where('SUBSTRING(translation.name , 1, 1) NOT IN (:list)')
                ->setParameter('list', range('a', 'z'));
        } else {
            $query
                ->innerJoin('g.translations', 'translation')
                ->where('SUBSTRING(translation.name , 1, 1) = :letter')
                ->setParameter('letter', $letter);
        }
        $query
            ->andWhere('translation.locale = :locale')
            ->setParameter('locale', $locale)
            ->orderBy('translation.name', 'ASC');

        $this->onlyActive($query);
        $this->withPlatforms($query);

        return $query->getQuery();
    }
public function findWithLetter($letter, $locale)
    {
        $query = $this->createQueryBuilder('g')
            ->addSelect('translation');
        if ($letter === '0') {
            $query
                ->innerJoin('g.translations', 'translation')
                ->where('SUBSTRING(translation.name , 1, 1) NOT IN (:list)')
                ->setParameter('list', range('a', 'z'));
        } else {
            $query
                ->innerJoin('g.translations', 'translation')
                ->where('SUBSTRING(translation.name , 1, 1) = :letter')
                ->setParameter('letter', $letter);
        }
        $query
            ->andWhere('translation.locale = :locale')
            ->setParameter('locale', $locale)
            ->orderBy('translation.name', 'ASC');

        $this->onlyActive($query);
        $this->withPlatforms($query);

        return $query->getQuery();
    }
public function findWithLetter ( $ letter , $ locale ) { $ query = $ this -> createQueryBuilder ( 'g' ) -> addSelect ( 'translation' ) ; if ( $ letter === '0' ) { $ query -> innerJoin ( 'g.translations' , 'translation' ) -> where ( 'SUBSTRING(translation.name , 1, 1) NOT IN (:list)' ) -> setParameter ( 'list' , range ( 'a' , 'z' ) ) ; } else { $ query -> innerJoin ( 'g.translations' , 'translation' ) -> where ( 'SUBSTRING(translation.name , 1, 1) = :letter' ) -> setParameter ( 'letter' , $ letter ) ; } $ query -> andWhere ( 'translation.locale = :locale' ) -> setParameter ( 'locale' , $ locale ) -> orderBy ( 'translation.name' , 'ASC' ) ; $ this -> onlyActive ( $ query ) ; $ this -> withPlatforms ( $ query ) ; return $ query -> getQuery ( ) ; }
Finds games begining with a letter.

@param string $letter
@param string $locale

@return \Doctrine\ORM\Query
Finds games begining with a letter .