本文整理汇总了PHP中Zend\EventManager\EventManager::setIdentifiers方法的典型用法代码示例。如果您正苦于以下问题:PHP EventManager::setIdentifiers方法的具体用法?PHP EventManager::setIdentifiers怎么用?PHP EventManager::setIdentifiers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\EventManager\EventManager
的用法示例。
在下文中一共展示了EventManager::setIdentifiers方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getEventManager
private function getEventManager()
{
if (!$this->eventManager) {
$this->eventManager = new EventManager();
$this->eventManager->setIdentifiers(get_class($this));
}
return $this->eventManager;
}
示例2: createPrivateEventManager
/**
* @return EventManagerInterface
*/
private function createPrivateEventManager($eventClazz)
{
$events = new EventManager();
$events->setIdentifiers(array('ZfcUserAdmin', $eventClazz));
$events->setEventClass($eventClazz);
return $events;
}
示例3: let
/**
* @param \Zend\EventManager\EventManager $eventManager
*/
public function let($eventManager)
{
$eventManager->trigger(Argument::cetera())->willReturn(true);
$eventManager->setIdentifiers(Argument::cetera())->willReturn(true);
$eventManager->attach(Argument::cetera())->willReturn(true);
$this->setEventManager($eventManager);
}
示例4: createServiceWithName
public function createServiceWithName(ServiceLocatorInterface $serviceManager, $name, $requestedName)
{
$eventManager = new ZendEventManager();
$entityEventManager = new EntityEventManager($eventManager);
$entityParams = explode('\\', $requestedName);
if (isset($entityParams[0])) {
$eventManager->setIdentifiers($entityParams[0]);
}
return $entityEventManager;
}
示例5: getEventManager
/**
* Attempt to marshal an EventManager instance.
*
* If an instance is already available, return it.
*
* If the zend-eventmanager component is not present, return nothing.
*
* Otherwise, marshal the instance in a version-agnostic way, and return
* it.
*
* @return null|EventManager
*/
private function getEventManager()
{
if ($this->events) {
return $this->events;
}
if (!class_exists(EventManager::class)) {
return;
}
$this->events = new EventManager();
$this->events->setIdentifiers([__CLASS__]);
return $this->events;
}
示例6: authenticate
/**
* @param AdapterInterface|null $adapter
* @return AuthResult
*/
public function authenticate(AdapterInterface $adapter = null)
{
$event = new AuthenticationEvent();
$event->setTarget($this);
if (!$adapter) {
$adapter = $this->adapter;
}
if ($adapter) {
$event->setAdapter($adapter);
}
$eventManager = new EventManager();
$eventManager->setIdentifiers(get_class($this));
$eventManager->trigger($event);
return $event->getResult();
}
示例7: setEventManager
/**
* Set EventManager instance
*
* @param EventManager $eventManager
*
* @return void
*/
public function setEventManager(EventManager $eventManager)
{
$this->eventManager = $eventManager;
$this->eventManager->setIdentifiers(array('EventStore'));
}
示例8: index09Action
public function index09Action()
{
$eventManagerOne = new EventManager();
//$eventManagerOne = new EventManager(array("emOne","emTwo"));
$eventManagerOne->setIdentifiers(array("emOne", "emTwo"));
$listener1 = $eventManagerOne->attach("eventOne", function ($e) {
echo "<h3 style='color:red;font-weight:bold'>eventManagerOne - eventOne - Do 1</h3>";
});
$eventManagerOne->trigger("eventOne");
$ids = $eventManagerOne->getIdentifiers();
echo "<pre style='font-weight:bold'>";
print_r($ids);
echo "</pre>";
return false;
}
示例9: setEventManager
/**
* Inject an EventManager instance
*
* @param EventManagerInterface $eventManager
*
* @return void
*/
public function setEventManager(EventManagerInterface $eventManager)
{
$this->eventManager = $eventManager;
$this->eventManager->setIdentifiers(self::EVENT_MANAGER_IDENTIFIER);
}