symfony - How to make queryBuilder in build form using A2lix Translated Entity -
in form, i'm trying display items list connected user using a2lix. when try code bellow, error.
error message
could not parse property path "translations[en].". unexpected token "." @ position 16
part of build form
->add('artwork','a2lix_translatedentity',array('class'=>'ctcartworkbundle:artwork', 'query_builder' => function (entityrepository $er) { return $er->createquerybuilder('a') ->where('a.userid = :userid') ->setparameter('userid',$this->user) ->orderby('a.title', 'asc'); }, 'multiple'=>false, 'expanded'=>false, 'empty_value' => 'choose artwork',))
i red a2lixdoc make querybuilder it's not working , "using custom query entities"
any advice me.
this code works fine me.
i read again a2lix documentation , saw need use 'translation_property' => 'title', instead of 'property' => 'title'.
array('class'=>'ctcartworkbundle:artwork', 'translation_property' => 'title', 'query_builder' => function (entityrepository $er) { return $er->createquerybuilder('a') ->where('a.user = :userid') ->setparameter('userid',$this->user); }, 'multiple'=>false, 'expanded'=>false, 'empty_value' => 'choose artwork',))
Comments
Post a Comment