I have a question for you all. I'm just starting to use Zend Framework after I have used Codeigniter for about 1 year now. I have installed everything and everything is running now. But I have one problem. I want to use Doctrine for my modelling. And I always used the PersistentObject from Doctrine, but I can't seem to get it working.
The problem is that I need to pass through a ObjectManager to the PersistentObject. But I can't make it work. Does anybody have any idea how I can pass through the ObjectManger from the DoctrineORM module to the PersistentObject?
If I'm not clear enough you can tell me. It's a bit an hassle for me to speak english. I'm sorry about that!
You could do it in your Module's onBootstrap() method:
<?php
namespace MyApplication;
use Doctrine\Common\Persistence\PersistentObject;
class Module {
public function onBootstrap($e){
$serviceManager = $e->getApplication()->getServiceManager();
PersistentObject::setObjectManager($sm->get('Doctrine\ORM\EntityManager');
}
}