title: Doctrine Paginator Iteration is an array of 1 object
body: <p>I'm trying to use doctrines Paginate class to fetch some tasks.</p>
  
  <pre><code>$qb = $this-&gt;getEntityManager()
              -&gt;createQueryBuilder()
              -&gt;select('DISTINCT task, priority, company, invoice')
              -&gt;addSelect('priority.id as priority_id')
              -&gt;from('TekniqSD4Bundle:task', 'task')
              -&gt;leftJoin('task.slips', 'slips')
              -&gt;leftJoin('task.comments', 'comments')
              -&gt;leftJoin('task.files', 'files')
              -&gt;leftJoin('task.steps', 'steps')
              -&gt;leftJoin('task.status', 'status')
              -&gt;join('task.invoice', 'invoice')
              -&gt;join('task.priority', 'priority')
              -&gt;join('invoice.company', 'company');
  
  $query = $qb-&gt;getQuery()
              -&gt;setMaxResults(2)  
              -&gt;setFirstResult($offset);
  $paginator = new Paginator($query, true);
  foreach($paginator as $task){
      var_dump($task); //this spits out an array containing 1 task
  }
  </code></pre>
  
  <p>My question is, why is $task an array?</p>