addType() 공개 메소드

To change the default listener, use the following:
  $ob->addType('default', '*', $classname);
public addType ( string $listener, string $type, string $class )
$listener string The listener name.
$type string The listener type.
$class string The Event class to use.
예제 #1
0
 /**
  */
 public function create(Horde_Injector $injector)
 {
     global $registry;
     if (isset($this->_notify)) {
         return $this->_notify;
     }
     $this->_notify = new Horde_Core_Notification_Handler(new Horde_Core_Notification_Storage_Session());
     $this->_notify->addType('default', '*', 'Horde_Core_Notification_Event_Status');
     $this->_notify->addType('status', 'horde.*', 'Horde_Core_Notification_Event_Status');
     $this->_notify->addDecorator(new Horde_Notification_Handler_Decorator_Alarm($injector->getInstance('Horde_Core_Factory_Alarm'), $registry->getAuth()));
     $this->_notify->addDecorator(new Horde_Core_Notification_Handler_Decorator_Hordelog());
     return $this->_notify;
 }
예제 #2
0
 /**
  * Modifies the global notification handler.
  *
  * @param Horde_Notification_Handler $handler  A notification handler.
  */
 public function setupNotification(Horde_Notification_Handler $handler)
 {
     $handler->addDecorator(new IMP_Notification_Handler_Decorator_ImapAlerts());
     $handler->addDecorator(new IMP_Notification_Handler_Decorator_NewmailNotify());
     $handler->addType('status', 'imp.*', 'IMP_Notification_Event_Status');
 }