Bundle/BlogBundle/Repository/BlogRepository.php
public function getUsedLocales()
    {
        $queryBuilder = $this->createQueryBuilder('blog')
            ->select('DISTINCT(b_translation.locale) AS locale')
            ->join('blog.translations', 'b_translation');

        $locales = [];
        foreach ($queryBuilder->getQuery()->getResult() as $locale) {
            $locales[] = $locale['locale'];
        }

        return $locales;
    }
public function getUsedLocales()
    {
        $queryBuilder = $this->createQueryBuilder('blog')
            ->select('DISTINCT(b_translation.locale) AS locale')
            ->join('blog.translations', 'b_translation');

        $locales = [];
        foreach ($queryBuilder->getQuery()->getResult() as $locale) {
            $locales[] = $locale['locale'];
        }

        return $locales;
    }
public function getUsedLocales ( ) { $ queryBuilder = $ this -> createQueryBuilder ( 'blog' ) -> select ( 'DISTINCT(b_translation.locale) AS locale' ) -> join ( 'blog.translations' , 'b_translation' ) ; $ locales = [ ] ; foreach ( $ queryBuilder -> getQuery ( ) -> getResult ( ) as $ locale ) { $ locales [ ] = $ locale [ 'locale' ] ; } return $ locales ; }
Get all locales used by Blogs.

@return array
Get all locales used by Blogs .