namespace Quindimotos\ProyectoBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\ORM\EntityRepository;
class asignarEmpleadoAServicioType extends AbstractType {
public function buildForm(FormBuilderInterface $builder, array $options) {
$builder->add('ciudad', 'entity', array(
'empty_value' => 'Seleccione Empleado',
'class' => 'QuindimotosProyectoBundle:empleado',
'property_path' => false,
'query_builder' => function (EntityRepository $er) {
return $er->createQueryBuilder('e')
->join('e.cargo', 'c')
->from('QuindimotosProyectoBundle:Revision', 'r')
->join('r.empleado', 'e1')
->where('c.nombre =:cargo and r.empleado is not null')
->setParameter('cargo', 'tecnico');
}
))
->add('Revision', 'entity', array(
'empty_value' => 'Seleccione Revision Disponible',
'class' => 'QuindimotosProyectoBundle:revision',
'property_path' => false,
'query_builder' => function (EntityRepository $er) {
return $er->createQueryBuilder('r')
->where('r.recividopor is null');
}));
}
public function getName() {
return 'contact';
}
}
在下一行我不知道为什么它不起作用
->where('c.nombre =:cargo and r.empleado is null')
where 可以但条件“为空”的子句没有显示任何内容,但我知道有一些东西要显示。
在这一行中,这个子句 where is ok and "is null" 运行良好
->where('r.recividopor is null');
有人可以告诉我这是怎么回事。