title: Convert Doctrine 2 result object (entity) to array?
body: <p>I know that it is possible to specify that you want array type instead of object type when you run query with Doctrine. However, I happen to be working with the code that I can't edit which returns to me the result from a query as an object and I want to be able to convert that to array somehow. It seems like in the older version doctrine used to have something like <code>toArray()</code> which can be used. </p>
  
  <p>Is there something similar to that now which I can use?</p>