1
I am working with symfony2.16 I intend to select the person if this is not a foreign key in the user table my code is like this: public Function buildForm(Formbuilderinterface $Builder, array $options) {
$idPessoa = $options['idPessoa'];
$builder
->add('idPessoa', 'entity', array('class' => 'SUGASugaBundle:Pessoa',
'query_builder' => function(EntityRepository $er) use ($idPessoa){
return $er->createQueryBuilder('a')
->join('SUGASugaBundle:User','u')
->where('a.id != u.idPessoa')
->andwhere('a.id != :id')
->setParameter('id', $idPessoa)
->orderBy('a.nome');
},
'choice_label' => 'getNomeCompleto'
))
->remove('plainPassword')
->remove('username')
->add('save', 'submit', array('label' =>'Salvar'));
;
so it is to bring who already has user account