<?php


namespace AutoAdmin\Bundle\Content\Repository;


use AutoAdmin\Bundle\Content\Entity\StaticText;

/**
 * @method StaticText|null find($id, $lockMode = null, $lockVersion = null)
 * @method StaticText|null findOneBy(array $criteria, array $orderBy = null)
 * @method StaticText[]    findAll()
 * @method StaticText[]    findBy(array $criteria, array $orderBy = null, ?int $limit = null, ?int $offset = null)
 */
class StaticTextRepository extends AbstractTranslatableContentRepository
{
    /*
     * Used for caching all translations
     */
    public function findAllIndexed()
    {
        return $this->createQueryBuilder('_')
            ->join('_.translations', 'tv', '')
//            ->andWhere('tv.locale = :locale')
//            ->setParameter('locale', $locale)
            ->orderBy('_.domain', 'ASC')
            ->getQuery()
            ->getResult();
    }
}
