title: How To Utilize Doctrine2 Type Conversion on Native Query COLUMNS
body: <p>Could not find anything on this-- seems like it should be straight forward though.</p>
  
  <p>So the example the Doctrine2 docs give for type conversion on bound parameters looks like this:</p>
  
  <pre class="lang-php prettyprint-override"><code>$date = new \DateTime("2011-03-05 14:00:21");
  $stmt = $conn-&gt;prepare("SELECT * FROM articles WHERE publish_date &gt; ?");
  $stmt-&gt;bindValue(1, $date, "datetime");
  $stmt-&gt;execute();
  </code></pre>
  
  <p>What I want to do is specify the type conversion for one of the columns, but there is nothing in the documents or on StackOverflow that I could find. A pseudo-example of what this might look like:</p>
  
  <pre class="lang-php prettyprint-override"><code>$stmt = $conn -&gt; prepare("SELECT datetime FROM articles WHERE id = 1");
  $stmt -&gt; setType(0, "date_type"); // 0 being the column position, "date_type" being the PHP type to convert to
  </code></pre>
  
  <p>If anybody knows how to do this, (this is SQL not DQL), I would greatly appreciate. Thank you.</p>