src/yimaTheme/Module.php
public function onLoadModulesPostAddServices(ModuleEvent $e)
    {
        /** @var $moduleManager \Zend\ModuleManager\ModuleManager */
        $moduleManager = $e->getTarget();
        // $sharedEvents = $moduleManager->getEventManager()->getSharedManager();

        /** @var $sm ServiceManager */
        $sm      = $moduleManager->getEvent()->getParam('ServiceManager');
        $sm->setInvokableClass('yimaTheme.ThemeObject', 'yimaTheme\Theme\Theme', false);
    }
public function onLoadModulesPostAddServices(ModuleEvent $e)
    {
        /** @var $moduleManager \Zend\ModuleManager\ModuleManager */
        $moduleManager = $e->getTarget();
        // $sharedEvents = $moduleManager->getEventManager()->getSharedManager();

        /** @var $sm ServiceManager */
        $sm      = $moduleManager->getEvent()->getParam('ServiceManager');
        $sm->setInvokableClass('yimaTheme.ThemeObject', 'yimaTheme\Theme\Theme', false);
    }
public function onLoadModulesPostAddServices ( ModuleEvent $ e ) { /** @var $moduleManager \Zend\ModuleManager\ModuleManager */ $ moduleManager = $ e -> getTarget ( ) ; // $sharedEvents = $moduleManager->getEventManager()->getSharedManager(); /** @var $sm ServiceManager */ $ sm = $ moduleManager -> getEvent ( ) -> getParam ( 'ServiceManager' ) ; $ sm -> setInvokableClass ( 'yimaTheme.ThemeObject' , 'yimaTheme\Theme\Theme' , false ) ; }
! Because we wan't share by default set to false

@param ModuleEvent $e
! Because we wan t share by default set to false