本文整理汇总了PHP中Zend\ModuleManager\ModuleManagerInterface::getEvent方法的典型用法代码示例。如果您正苦于以下问题:PHP ModuleManagerInterface::getEvent方法的具体用法?PHP ModuleManagerInterface::getEvent怎么用?PHP ModuleManagerInterface::getEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\ModuleManager\ModuleManagerInterface
的用法示例。
在下文中一共展示了ModuleManagerInterface::getEvent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Init
*/
public function init(ModuleManagerInterface $moduleManager)
{
// get service manager
$this->serviceLocator = $moduleManager->getEvent()->getParam('ServiceManager');
$moduleManager->getEventManager()->attach(ModuleEvent::EVENT_LOAD_MODULES_POST, [$this, 'initApplication']);
$eventManager = AclEvent::getEventManager();
$eventManager->attach(AclEvent::DELETE_ROLE, function ($e) use($moduleManager) {
$userModel = $moduleManager->getEvent()->getParam('ServiceManager')->get('Application\\Model\\ModelManager')->getInstance('User\\Model\\UserBase');
// change the empty role with the default role
$userModel->updateUsersWithEmptyRoles(AclBaseModel::DEFAULT_ROLE_MEMBER);
}, -100);
}
示例2: init
/**
* @param ModuleManagerInterface $moduleManager
*/
public function init(ModuleManagerInterface $moduleManager)
{
$moduleManager->loadModule('AssetManager');
$sm = $moduleManager->getEvent()->getParam('ServiceManager');
$serviceListener = $sm->get('ServiceListener');
$serviceListener->addServiceManager('JQueryPluginManager', 'jquery_plugins', JQueryPluginProviderInterface::class, 'getJQueryPluginConfig');
}
示例3: init
/**
* {@inheritdoc}
*/
public function init(ModuleManagerInterface $moduleManager)
{
/** @var ServiceManager $serviceManager */
$serviceManager = $moduleManager->getEvent()->getParam('ServiceManager');
/** @var ServiceListenerInterface $serviceListener */
$serviceListener = $serviceManager->get('ServiceListener');
$serviceListener->addServiceManager(DataMapper\Manager\DataMapperManager::class, 'thorr_persistence_dmm', DataMapper\Manager\DataMapperManagerConfigProviderInterface::class, 'getDataMapperManagerConfig');
}
示例4: init
/**
* Initialize workflow
*
* @param ModuleManagerInterface $manager
* @return void
*/
public function init(ModuleManagerInterface $manager)
{
$this->moduleManager = $manager;
$this->serviceLocator = $manager->getEvent()->getParam('ServiceManager');
$shared = $manager->getEventManager()->getSharedManager();
$shared->attach('Zend\\Stdlib\\DispatchableInterface', MvcEvent::EVENT_DISPATCH, array(new InjectTemplateListener(), 'injectTemplate'), -85);
$shared->attach('Zend\\Stdlib\\DispatchableInterface', MvcEvent::EVENT_DISPATCH, array($this, 'onDispatch'), 100);
}
示例5: init
/**
* {@inheritDoc}
*/
public function init(ModuleManagerInterface $manager)
{
$events = $manager->getEventManager();
// Initialize logger collector once the profiler is initialized itself
$events->attach('profiler_init', function (EventInterface $e) use($manager) {
$manager->getEvent()->getParam('ServiceManager')->get('doctrine.couch_logger_collector.odm_default');
});
}
示例6: init
public function init(ModuleManagerInterface $moduleManager)
{
/** @var ServiceListener $serviceListener */
$serviceListener = $moduleManager->getEvent()->getParam('ServiceManager')->get('ServiceListener');
$serviceListener->addServiceManager(AuthorizationConditionPluginManager::class, 'zource_conditions', '', '');
$serviceListener->addServiceManager(UiNavigationItemPluginManager::class, 'zource_ui_nav_items', '', '');
$this->initializeErrorLogging();
}
示例7: init
/**
* Init
*
* @param \Zend\ModuleManager\ModuleManagerInterface
* @return void
*/
public function init(ModuleManagerInterface $moduleManager)
{
// get the service manager
$this->serviceLocator = $moduleManager->getEvent()->getParam('ServiceManager');
// get the module manager
$this->moduleManager = $moduleManager;
$moduleManager->getEventManager()->attach(ModuleEvent::EVENT_LOAD_MODULES_POST, [$this, 'initApplication']);
}
示例8: init
public function init(ModuleManagerInterface $manager)
{
$events = $manager->getEventManager();
// Initialize logger collector once the profiler is initialized itself
$events->attach('profiler_init', function () use($manager) {
$manager->getEvent()->getParam('ServiceManager')->get('doctrine.sql_logger_collector.orm_another');
// moduificare nome
});
}
示例9: init
/**
* {@inheritDoc}
*/
public function init(ModuleManagerInterface $manager)
{
$events = $manager->getEventManager();
// Initialize logger collector once the profiler is initialized itself
$events->attach('profiler_init', function () use($manager) {
$manager->getEvent()->getParam('ServiceManager')->get('doctrine.sql_logger_collector.orm_default');
});
$events->getSharedManager()->attach('doctrine', 'loadCli.post', array($this, 'initializeConsole'));
}
示例10: init
/**
* init
*
* Initialise the modules services.
*
* @param ModuleManagerInterface $moduleManager
*/
public function init(ModuleManagerInterface $moduleManager)
{
/**
* @var ModuleManager $moduleManager
* @var ServiceManager $serviceManager
* @var ServiceListener $serviceListener
*/
$serviceManager = $moduleManager->getEvent()->getParam('ServiceManager');
$serviceListener = $serviceManager->get('ServiceListener');
$serviceListener->addServiceManager('EntityServiceManager', 'entity_service_manager', EntityServiceProviderInterface::class, 'getEntityServiceConfig');
}
示例11: deleteUserMembershipLevels
/**
* Delete user's membership levels +
*
* @param \Zend\ModuleManager\ModuleManagerInterface $moduleManager
* @param integer $userId
* @return void
*/
protected function deleteUserMembershipLevels(ModuleManagerInterface $moduleManager, $userId)
{
$model = $moduleManager->getEvent()->getParam('ServiceManager')->get('Application\\Model\\ModelManager')->getInstance('Membership\\Model\\MembershipBase');
// delete all user's connections
if (null != ($connections = $model->getAllUserMembershipConnections($userId))) {
foreach ($connections as $connection) {
// delete the connection
if (false === ($deleteResult = $model->deleteMembershipConnection($connection->id))) {
break;
}
}
}
}
示例12: init
/**
* {@inheritDoc}
*/
public function init(ModuleManagerInterface $moduleManager)
{
if (class_exists('ZendDeveloperTools\\Module')) {
$moduleManager->loadModule('ZendDeveloperTools');
}
$moduleManager->loadModule('OcraCachedViewResolver');
$moduleManager->loadModule('StrokerCache');
$moduleManager->loadModule('CmsJquery');
$sm = $moduleManager->getEvent()->getParam('ServiceManager');
$serviceListener = $sm->get('ServiceListener');
$serviceListener->addServiceManager('MapperManager', 'mappers', MapperPluginProviderInterface::class, 'getMapperConfig');
$serviceListener->addServiceManager('DomainServiceManager', 'domain_services', DomainServicePluginProviderInterface::class, 'getDomainServiceConfig');
$serviceListener->addServiceManager('SessionContainerManager', 'session_containers', ContainerPluginProviderInterface::class, 'getSessionContainerConfig');
}
示例13: init
/**
* init
*
* @param \Zend\ModuleManager\ModuleManagerInterface $moduleManager
*/
public function init(ModuleManagerInterface $moduleManager)
{
$serviceManager = $moduleManager->getEvent()->getParam('ServiceManager');
$serviceListener = $serviceManager->get('ServiceListener');
$serviceListener->addServiceManager('EntityRepositoryManager', 'entity_repository_manager', 'ArpEntityRepository\\ModuleManager\\Feature\\EntityRepositoryProviderInterface', 'getEntityRepositoryConfig');
}
示例14: init
/**
* Initialize workflow
*
* @param ModuleManagerInterface $moduleManager
*
* @return void
*/
public function init(ModuleManagerInterface $moduleManager)
{
$serviceManager = $moduleManager->getEvent()->getParam('ServiceManager');
$serviceListener = $serviceManager->get('ServiceListener');
$serviceListener->addServiceManager('Phpro\\MailManager\\PluginManager', 'mail_manager', 'Phpro\\MailManager\\Mail\\MailInterface', 'getMailManagerConfig');
}
示例15: init
/**
*
* @param ModuleManagerInterface $manager
*/
public function init(ModuleManagerInterface $manager)
{
$sm = $manager->getEvent()->getParam('ServiceManager');
$serviceListener = $sm->get('ServiceListener');
$serviceListener->addServiceManager('BlockManager', 'blocks', 'ConLayout\\ModuleManager\\Feature\\BlockProviderInterface', 'getBlockConfig');
}