title: Expected argument of type "object or array", "integer" given
body: <p>I'm facing an error when building an form item using an entity type with a custom query. Without the custom query it worked fine... so I suppose that the problem lies somewhere in the query.</p>
  
  <p>That's the excerpt from type.php</p>
  
  <pre><code>public function buildForm(FormBuilderInterface $builder, array $options)
      {
          $builder
              -&gt;add('Event', 'entity', array(
                  'class' =&gt; 'EventBundle:Event',
                  'query_builder' =&gt; function(EntityRepository $er){
                      return $er-&gt;createQueryBuilder('e')
                          -&gt;select('e.id, g.title')
                          -&gt;leftJoin('e.Group g')
                          -&gt;orderBy('e.start', 'DESC');
                  },
                  'property' =&gt; 'title',
                  'empty_value' =&gt; 'Please choose an event...'
              ))
  </code></pre>
  
  <p>I can see that the query works fine... this are the values that create the exception.</p>
  
  <blockquote>
    <p>PropertyAccessor ->readPropertiesUntil ('77', object(PropertyPath),
    '1') in
    /vendor/symfony/symfony/src/Symfony/Component/PropertyAccess/PropertyAccessor.php
    at line 49</p>
  </blockquote>
  
  <p>Thanks for any help</p>