->add('item', 'entity', array(
'class' => 'AcmeHelloBundle:Item',
'property' => 'title',
));
$builder->add('item', 'entity', array(
'class' => 'AcmeHelloBundle:Item',
'query_builder' => function(EntityRepository $er) {
return $er->createQueryBuilder('u')
->orderBy('u.username', 'ASC');
},
));