title: MySQL NOW() in Doctrine DBAL insert?
body: <p>I'm staring at <a href="http://doctrine-dbal.readthedocs.org/en/latest/reference/data-retrieval-and-manipulation.html#insert" rel="nofollow noreferrer">http://doctrine-dbal.readthedocs.org/en/latest/reference/data-retrieval-and-manipulation.html#insert</a></p>
  
  <p>I'd love to be able to do something like</p>
  
  <pre><code>$db-&gt;insert('mytable', [
    'foo' =&gt; 'bar',
    'created_on' =&gt; new MagicThatMakesNowWork()
  ]);
  </code></pre>
  
  <p>Is this impossible? The best solution I've seen is using PHP to get the datetime while setting the timezone, which is less than ideal. For some reason it seems only the ORM or query builder can handle expressions. I know in Zend I can do something like <code>new Zend_Db_Expr('NOW()')</code> and it knows by the object type not to quote <code>NOW()</code> in the built query. No query builder or ORM required.</p>
  
  <p>Not sure if it's not possible or not documented well. The second answer on <a href="https://stackoverflow.com/questions/11258858/doctrine-dbal-updating-timestamp-field-with-now-value">Doctrine DBAL: Updating timestamp field with &#39;NOW()&#39; value</a> shows a random string of <code>datetime</code> in the types array which seems weird/bad as well.</p>