How to override EntityManager in ZF2
MyEntityManager extends \Doctrine\ORM\EntityManager {
}
So after using
$this->getServiceLocator()->get('Doctrine\ORM\EntityManager')
or
$this->getServiceLocator()->get('doctrine.entitymanager.orm_default')
I will get MyEntityManager.
Edit In comments I also asked about How to create aliases (shortcuts) for entity namespaces.
getRepository('Application\Entity\Some\Very\Nested\MyEntity')
getRepository('NestedShortcut:MyEntity')