module/FzyCommon/Module.php
public function onBootstrap(EventInterface $e)
	{
		/* @var $sm \Zend\ServiceManager\ServiceLocatorInterface */
		$sm = $e->getApplication()->getServiceManager();
		/* @var $em \Doctrine\ORM\EntityManager */
		$em = $sm->get('Doctrine\ORM\EntityManager');
		$em->getEventManager()->addEventSubscriber(new ServiceAwareEntityListener($sm));
	}
public function onBootstrap(EventInterface $e)
	{
		/* @var $sm \Zend\ServiceManager\ServiceLocatorInterface */
		$sm = $e->getApplication()->getServiceManager();
		/* @var $em \Doctrine\ORM\EntityManager */
		$em = $sm->get('Doctrine\ORM\EntityManager');
		$em->getEventManager()->addEventSubscriber(new ServiceAwareEntityListener($sm));
	}
Listen to the bootstrap event

@param EventInterface $e
@return array