public function trigger(NotificationInterface $notification)
{
foreach ($this->getHandlers() as $handler) {
if ($handler->shouldHandle($notification)) {
if ($logger = $this->getLogger()) {
$message = sprintf('notification handler "%s" processed message', get_class($handler));
$logger->info($message, array('Notification' => serialize($notification)));
}
if (false === $handler->handle($notification)) {
return true;
}
}
}
return true;
}