title: How to fetch class instead of array in Doctrine 2
body: <p>I am able to fetch my data from database by using this structure:</p>
  
  <pre><code>$user = $this-&gt;getDoctrine()
  -&gt;getRepository('AcmeDemoBundle:Emails')
  -&gt;find(8081);
  </code></pre>
  
  <p>When I do that, I am able to get my data like this:</p>
  
  <pre><code>$user-&gt;getColumnNameHere();
  </code></pre>
  
  <p>Basically I am able to use <strong>Entity</strong> Class.</p>
  
  <p>But if I want to use QueryBuilder instead of <code>find</code> I am only getting associative arrays.</p>
  
  <pre><code>$product-&gt;createQueryBuilder('p')
          -&gt;setMaxResults(1)
          -&gt;where('p.idx = :idx')
          -&gt;select('p.columnNameHere')
          -&gt;setParameter('idx', 8081)
          -&gt;orderBy('p.idx', 'DESC')
          -&gt;getQuery();
          $product = $query-&gt;getResult();
  </code></pre>
  
  <p>$product returnds as array. Is it possible to fetch it withj Entity Managaer Class? If yes, how?</p>
  
  <p>I digg the documentation but it seems not possible or not exist in the doc or I'm just blind :)</p>