-1
->add('supervisor','entity', array(
          'class' => 'AdminBundle:Managers',
          'expanded' => false,
          'multiple' => false,
            )

So I want the class property to take this query:

select e.firstname,e.middlename,e.lastname from employee e, user u where e.staffid=u.staffid and  u.role=3
BartoszKP
  • 34,786
  • 15
  • 102
  • 130
Lamin L. Janneh
  • 85
  • 1
  • 1
  • 6
  • possible duplicate of [custom query in entity field type](http://stackoverflow.com/questions/8456298/custom-query-in-entity-field-type) – dk80 Aug 10 '15 at 10:41
  • I think query_builder allow only the symfony2 query builder notation but does it allow DQL queries which is sql like query thanks for the reply! – Lamin L. Janneh Aug 11 '15 at 12:54

1 Answers1

0

Use the query_builder option to create a custom query that will be used when fetching the drop-down options. Here you can add joins and conditions to create the custom query.

http://symfony.com/doc/current/reference/forms/types/entity.html#using-a-custom-query-for-the-entities

dk80
  • 556
  • 2
  • 13