title: Twig doesn't show data in object
body: <p>I'm trying to use Twig to display a simple list of Doctrine 2 entity objects. The objects are fetched with the untouched results from a DQL query. 
  The PHP code is like this:</p>
  
  <pre><code>/*
   * I know the query in the Repository class works as I get the correct objects
   * from the method and can iterate through them with foreach in PHP, displaying
   * data from the object through getters, like -&gt;getId()
   */
  $received = $repo-&gt;getReceived($id);
  
  /*
   * This appears to work, the variables are assigned correctly.
   */
  echo $template-&gt;render(array("received" =&gt; $received, "first" =&gt; $received[0]));
  </code></pre>
  
  <p>The Twig template contains this:</p>
  
  <pre><code>{% for item in received %}
      &lt;li&gt;Item: {{ item.id }}, {{ first.id }}&lt;/li&gt;
  {% endfor %}
  </code></pre>
  
  <p>The strange thing is that twig iterates through the received array correctly, there are three objects in the array and there are three lines output but the id (or any other member) doesn't come out when accessed as item.id but the second output, first.id, comes out correctly.</p>
  
  <p>What I should be seeing is this:</p>
  
  <pre><code>Item 1, 1
  Item 2, 1
  Item 3, 1
  </code></pre>
  
  <p>but instead I'm seeing:</p>
  
  <pre><code>Item , 1
  Item , 1
  Item , 1
  </code></pre>
  
  <p>I've tried different variations to get the output but nothing has worked so far, item.getId, item.getId().</p>
  
  <p>Any ideas what I am missing here?</p>
  
  <p><strong>Edit</strong> dump output</p>
  
  <p>{{ dump(received) }} returns the following:</p>
  
  <pre><code>array(3) {
    [0]=&gt;
    object(Received)#219 (6) {
      ["id":"Received":private]=&gt;
      int(1)
    ... snip ...
    }
    [1]=&gt;
    object(Received)#208 (6) {
      ["id":"Received":private]=&gt;
      int(2)
    ... snip ...
    }
    [2]=&gt;
    object(Received)#210 (6) {
      ["id":"Received":private]=&gt;
      int(3)
    ... snip ...
  </code></pre>
  
  <p>I've cut it down, these are three full blown Doctrine entity objects so they are in the array and look correct.</p>