Hi,
i'm using Entity form type, choice based, in order to provide a choice list inside a Sonata Admin form. What i would like is to use a child property to display the collection of elements inside the choice list.
Does any one knows how to provide the label to be shown inside the chocie list or how to give format to the choice list array?
$formMapper->add( 'frArea', 'entity', array(
'class' => 'myVendor\myBundleBundle\View\FrArea',
//When using a child property here, choice list gets corrupted/bad formatted
'property' => 'idArea',
'em' => 'formacions',
'query_builder' => function( EntityRepository $er )
{
return $er->createQueryBuilder( 'qb' )
->add( 'select', 'a' )
->add( 'from', 'myVendor\myBundleBundle\View\FrArea a' );
//->leftJoin('a.idiomes', 'ai');
},
'required' => false,
'label' => ucfirst( $this->trans( 'my_label', array(), $this->translationDomain, $this->langCode ) )
) );