Right now, I think that is not possible. you can use DQL function
CONCAT(str1, str2) to join first and last name, that might work.

'query_builder'  => function ($userRepository) {
             return $userRepository->createQueryBuilder('u')-
>select(concat(u.firstName, " ", u.lastName) ->where('u.active =
                             ?1')->setParameter(1, '1');

Hope it helps!!

On Feb 14, 9:33 am, jdewit <jorisdewitblackbe...@gmail.com> wrote:
> Is it possible to pass multiple properties in the entityChoiceField so that
> the value consist of multiple fields? For example, first and last name.
>
> Passing an array results in an error.
>
>       $this->add(new EntityChoiceField('salesRep', array(
>          'em' => $em,
>          'empty_value' => 'Select',
>          'class' => 'Sensio\HelloBundle\Entity\User',
>          'property' => array('firstName','lastName'),
>          'query_builder' => function ($userRepository) {
>              return
> $userRepository->createQueryBuilder('u')->where('u.active =
> ?1')->setParameter(1, '1');
>
>          },
>        )));
>
> Thanks!

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to