Wants to convert doctrine entiry object to normal array, this is my code so far,
$demo = $this->doctrine->em->find(\'Entity\\User\',2);
If you alread have the object entity fetched form the database, you could also work with the DoctrineModule\Stdlib\Hydrator\DoctrineObject.
/**
* Assume your entity for which you want to create an array is in $entityObject.
* And it is an instance of YourEntity::class.
*/
$tmpObject = new DoctrineObject($this->entityManager, YourEntity::class);
$data = $tmpObject->extract($entityObject);
Now $data will contain your object as array.
P.S. I'm not sure this was possible when the question was asked.