本文整理匯總了PHP中Symfony\Component\EventDispatcher\Event::isPropagationStopped方法的典型用法代碼示例。如果您正苦於以下問題:PHP Event::isPropagationStopped方法的具體用法?PHP Event::isPropagationStopped怎麽用?PHP Event::isPropagationStopped使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Component\EventDispatcher\Event
的用法示例。
在下文中一共展示了Event::isPropagationStopped方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: doDispatch
/**
* {@inheritdoc}
*/
protected function doDispatch($listeners, $eventName, Event $event)
{
foreach ($listeners as $listener) {
if ($event->isPropagationStopped()) {
break;
}
$this->currentListenerSniffCodeProvider->setCurrentListener($listener);
call_user_func($listener, $event, $eventName, $this);
}
}
示例2: brocast
protected function brocast(Event $event)
{
$eventName = $event->getName();
$listeners = [];
foreach ($this->events[$eventName] as &$eventGroup) {
foreach ($eventGroup as $listenerArray) {
list($listener, $priority) = $listenerArray;
$listeners[$priority][] = $listener;
}
}
krsort($listeners);
$processCount = 0;
foreach ($listeners as $listener) {
foreach ($listener as $callback) {
if ($event && $event->isPropagationStopped()) {
return $processCount;
}
$callback($event);
$processCount++;
}
}
return $processCount;
}
示例3: testStopPropagationAndIsPropagationStopped
public function testStopPropagationAndIsPropagationStopped()
{
$this->event->stopPropagation();
$this->assertTrue($this->event->isPropagationStopped());
}
示例4: dispatch
/**
* {@inheritdoc}
*/
public function dispatch($eventName, Event $event = null)
{
if (null === $event) {
$event = new Event();
}
if (null !== $this->logger && $event->isPropagationStopped()) {
$this->logger->debug(sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName));
}
$this->preProcess($eventName);
$this->preDispatch($eventName, $event);
$e = $this->stopwatch->start($eventName, 'section');
$this->dispatcher->dispatch($eventName, $event);
if ($e->isStarted()) {
$e->stop();
}
$this->postDispatch($eventName, $event);
$this->postProcess($eventName);
return $event;
}
示例5: isStopped
/**
* Determine if the event has been stopped from propagating.
*
* @return bool
*/
public function isStopped()
{
return parent::isPropagationStopped();
}