title: Best way to convert Doctrine 2 entity persistent collection to array with Zend Framework 2
body: <p>What is best way (easy) to convert Doctrine 2 entity persistent collection to array with Zend Framework 2? I want convert to array and later output it with JsonView. I can write function which use get_object_var but it is a problem when entity has next entity collection.</p>
  
  <p>Regards.</p>