alix entity field : a2lix_translatedEntity
Bonjour,
Pour mes traductions, j'utilise l'extension doctrine https://github.com/l3pp4rd/DoctrineE...ranslatable.md
Pour les formulaires, j'utilise A2lixTranslationFormBundle https://github.com/a2lix/TranslationFormBundle
Dans ma classe de formulaire de création de produit, j'ai ceci:
Code:
1 2 3 4 5 6 7 8 9 10
|
$builder->add('name')
->add('category', 'a2lix_translatedEntity', array(
'class' => 'MyappProductBundle:Category',
'translation_property' => 'name',
'query_builder' => function(EntityRepository $er) {
return $er->createQueryBuilder('c')
->where('c.active = 1');
},
)); |
Mais cela me retourne cette erreur :
Code:
1 2 3
| Notice: Trying to get property of non-object in ...\vendor\doctrine\orm\lib\Doctrine\ORM\Internal\Hydration\ObjectHydrator.php on line 480
Fatal error: Call to a member function fetch() on a non-object in ...\vendor\doctrine\orm\lib\Doctrine\ORM\Internal\Hydration\ObjectHydrator.php on line 149 |
Quelqu'un peut-il m'aider ? Merci.