本文整理匯總了PHP中Symfony\Component\EventDispatcher\Event::getMessage方法的典型用法代碼示例。如果您正苦於以下問題:PHP Event::getMessage方法的具體用法?PHP Event::getMessage怎麽用?PHP Event::getMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Component\EventDispatcher\Event
的用法示例。
在下文中一共展示了Event::getMessage方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: doDispatch
/**
* Triggers the listeners of an event UNLESS they are only listening to a different queue.
* Since we get an array of listener instances which are not tied any more to the service key, we have to do a slow
* loop to find if any listener was tied to a particular queue...
*
* @param callable[] $listeners The event listeners.
* @param string $eventName The name of the event to dispatch.
* @param Event $event The event object to pass to the event handlers/listeners.
*/
protected function doDispatch($listeners, $eventName, Event $event)
{
foreach ($listeners as $id => $listener) {
if (isset($this->listeners[$eventName])) {
foreach ($this->listeners[$eventName] as $key => $val) {
// services
if ($val[0] === $listener[0]) {
// queue names
if ($val[1] != null && $val[1] != $event->getMessage()->getQueueName()) {
continue 2;
}
break;
}
}
}
call_user_func($listener, $event, $eventName, $this);
if ($event->isPropagationStopped()) {
break;
}
}
}
示例2: addFlash
public function addFlash(Event $event)
{
$this->session->getFlashBag()->add($event->getType(), $event->getMessage());
}
示例3: onConditionChange
public function onConditionChange(Event $event)
{
$message = array('Message' => $event->getMessage(), 'Subject' => 'Condition change');
// $this->awsSns->publish($message);
$this->logger->info($event->getMessage());
}
示例4: setFlashMessageToEventParams
/**
* @param Event $event
*
* @return void
*/
private function setFlashMessageToEventParams(Event $event)
{
$this->flashHelper->setFlash($event->getMessageType(), $event->getMessage(), $event->getMessageParameters());
}