title: Nested Objects (mixed results from DQL select)
body: <p>I have a doctrine2 query like this:</p>
  
  <pre><code>$query = $this -&gt; doctrine -&gt; em -&gt; createQuery ("SELECT a, b FROM ORM\Dynasties2\Maillinks a JOIN a.msgId b");
  </code></pre>
  
  <p>It returns <a href="http://docs.doctrine-project.org/projects/doctrine-orm/en/2.0.x/reference/dql-doctrine-query-language.html#pure-and-mixed-results" rel="nofollow">mixed results</a>, similar to this:</p>
  
  <pre><code>ORM\Dynasties2\Maillinks Object 
  ( 
      [id:ORM\Dynasties2\Millinks:private] =&gt; 1 
      [toUser:ORM\Dynasties2\Maillinks:private] =&gt; 16 
      [isRead:ORM\Dynasties2\Maillinks:private] =&gt; 0 
      [msgId:ORM\Dynasties2\Maillinks:private] =&gt; ORM\Dynasties2\Mailmsgs Object 
      ( 
          [id:ORM\Dynasties2\Mailmsgs:private] =&gt; 1 
          [msgText:ORM\Dynasties2\Mailmsgs:private] =&gt; asdfasdfasdfasdfasdfasdf 
          [fromUser:ORM\Dynasties2\Mailmsgs:private] =&gt; 13 
          [timeStamp:ORM\Dynasties2\Mailmsgs:private] =&gt; DateTime Object 
          (       
              [date] =&gt; 2012-04-20 12:17:29 
              [timezone_type] =&gt; 3 
              [timezone] =&gt; America/Los_Angeles 
          ) 
          [onTurn:ORM\Dynasties2\Mailmsgs:private] =&gt; 1 
          [importance:ORM\Dynasties2\Mailmsgs:private] =&gt; 2 
          [msgType:ORM\Dynasties2\Mailmsgs:private] =&gt; 1 
      ) 
  )
  </code></pre>
  
  <p>I can access some of the data, at the 'top' easily enough.<br>
  <code>echo $row -&gt; getToUser();</code> returns '16'</p>
  
  <p>I tried <code>echo $row -&gt; msgId-&gt; getMsgText();</code> but that returns <code>Fatal error: Cannot access private property ORM\Dynasties2\Maillinks::$msgId</code></p>
  
  <p><strong>How do I access the data in the objects within?</strong></p>
  
  <p>Or:  is my query and result broken?  Do I need to do something different with my query or entities?</p>