title: how to convert Doctrine object into json
body: <p>I am using Doctrine 1.2, how could I get the query object into json / array format?</p>
  
  <pre><code>$user = Doctrine_Query::create()
  -&gt;select('u.id, u.username, u.firstname, u.lastname')
  -&gt;from('User u')
  -&gt;orderby('u.id')
  -&gt;execute();
  </code></pre>