I want create a multilingual web site, and for that I use Symfony with the PrezentBundle
and A2lixBundle
. I would get the list of my data by locale with entity repo.
I have this error :
FatalErrorException: Error: __clone method called on non-object in /project/vendor/doctrine/orm/lib/Doctrine/ORM/QueryBuilder.php line 238
Here is my repo :
$qb = $this->createQueryBuilder('c')
->leftJoin('c.criteres', 'crit')
->leftjoin('c.translations', 'ct', 'WITH', 'ct.locale = :locale')
->setParameters('locale', 'fr');
var_dump($qb->getDql() );
return $qb->getQuery()
->getResult();
The var_dump
give me that :
SELECT c FROM NS\MyBundle\Entity\CritereCateg c LEFT JOIN c.criteres crit LEFT JOIN c.translations ct WITH ct.locale = :locale