public function push($event, $type = null, array $flags = array(), $options = array())
{
if ($event instanceof Horde_Notification_Event) {
$event->flags = $flags;
$event->type = $type;
} else {
$class = !is_null($type) && ($listener = $this->get($type)) ? $listener->handles($type) : $this->_handles['default']['*'];
/* Transparently create a Horde_Notification_Event object. */
$event = new $class($event, $type, $flags);
}
foreach ($this->_decorators as $decorator) {
$decorator->push($event, $options);
}
if (!$this->_forceAttach && empty($options['immediate'])) {
$this->_storage->push('_unattached', $event);
} else {
if ($listener = $this->get($event->type)) {
$this->_storage->push($listener->getName(), $event);
}
}
}