title: Fetch multi-row, single-column array using Doctrine
body: <p>I have a Doctrine fetch statement like this</p>
  
  <pre><code>$query = "SELECT id FROM table LIMIT 2";
  $result = $db-&gt;fetchAll($query);
  </code></pre>
  
  <p>which returns the array like this:</p>
  
  <pre><code>Array
  (
  [0] =&gt; Array
      (
          [id] =&gt; 1
      )
  
  [1] =&gt; Array
      (
          [id] =&gt; 2
      )
  )
  </code></pre>
  
  <p>Since the only column I fetch is ID, I don't need the array scope do be that deep. Is there a convenient way of making Doctrine return the results in a "flat" array, similar to what what PDO does:</p>
  
  <pre><code>$result = $db-&gt;query($query)-&gt;fetchAll(PDO::FETCH_COLUMN);
  </code></pre>
  
  <p>will return</p>
  
  <pre><code>Array
  (
      [0] =&gt; 1
      [1] =&gt; 2
  )
  </code></pre>
  
  <p>Currently I am flattening it using</p>
  
  <pre><code>$result = call_user_func_array('array_merge', array_map("array_values", $result));
  </code></pre>