how can I select a specific field on a querybuilder in a form on symfony?
I'm triying to do this:
->add('tienda', EntityType::class, array(
'class' => 'AdminBundle:MyTable',
'query_builder' => function (EntityRepository $er) {
return $er->createQueryBuilder('select tienda')
->distinct()
->orderBy('u.tienda', 'ASC');
},
'required' => false,
))
Use
choice_label
option for ithttp://symfony.com/doc/current/reference/forms/types/entity.html#choice-label