PHP Класс Horde_Notification_Handler, horde

Автор: Jan Schneider ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_decorators array Decorators.
$_forceAttach boolean Forces immediate attachment of a notification to a listener.
$_handles array Additional handle definitions.
$_listeners array Hash containing all attached listener objects.
$_storage Horde_Notification_Storage The storage location where we store the messages.

Открытые методы

Метод Описание
__construct ( Horde_Notification_Storage_Interface $storage ) Initialize the notification system.
addDecorator ( Horde_Notification_Handler_Decorator_Base $decorator ) Add a decorator.
addType ( string $listener, string $type, string $class ) Adds a type handler to a given Listener.
attach ( string $listener, array $params = null, string $class = null ) : Horde_Notification_Listener Registers a listener with the notification object and includes the necessary library file dynamically.
clear ( string $listener = null ) Clear any notification events that may exist in a listener.
count ( string $my_listener = null ) : integer Return the number of notification messages in the stack.
detach ( $listener ) Remove a listener from the notification list.
get ( string $type ) : mixed Returns the current Listener object for a given listener type.
getListener ( string $listener ) : mixed Returns a listener object given a listener name.
notify ( array $options = [] ) Passes the message stack to all listeners and asks them to handle their messages.
push ( mixed $event, string $type = null, array $flags = [], array $options = [] ) Add an event to the Horde message stack.

Защищенные методы

Метод Описание
_addTypes ( string $listener ) Adds any additional listener types to a given Listener.

Описание методов

__construct() публичный Метод

Initialize the notification system.
public __construct ( Horde_Notification_Storage_Interface $storage )
$storage Horde_Notification_Storage_Interface The storage object to use.

_addTypes() защищенный Метод

Adds any additional listener types to a given Listener.
protected _addTypes ( string $listener )
$listener string The listener name.

addDecorator() публичный Метод

Add a decorator.
public addDecorator ( Horde_Notification_Handler_Decorator_Base $decorator )
$decorator Horde_Notification_Handler_Decorator_Base The Decorator object.

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.

attach() публичный Метод

Registers a listener with the notification object and includes the necessary library file dynamically.
public attach ( string $listener, array $params = null, string $class = null ) : Horde_Notification_Listener
$listener string The name of the listener to attach. These names must be unique; further listeners with the same name will be ignored.
$params array A hash containing any additional configuration or connection parameters a listener driver might need.
$class string The class name from which the driver was instantiated if not the default one. If given you have to include the library file containing this class yourself. This is useful if you want the listener driver to be overriden by an application's implementation
Результат Horde_Notification_Listener The listener object.

clear() публичный Метод

Clear any notification events that may exist in a listener.
public clear ( string $listener = null )
$listener string The name of the listener to flush. If null, clears all unattached events.

count() публичный Метод

Return the number of notification messages in the stack.
Автор: David Ulevitch ([email protected])
public count ( string $my_listener = null ) : integer
$my_listener string The name of the listener.
Результат integer The number of messages in the stack.

detach() публичный Метод

Remove a listener from the notification list.
public detach ( $listener )

get() публичный Метод

Returns the current Listener object for a given listener type.
public get ( string $type ) : mixed
$type string The listener type.
Результат mixed A Horde_Notification_Listener object, or null if $type listener is not attached.

getListener() публичный Метод

Returns a listener object given a listener name.
public getListener ( string $listener ) : mixed
$listener string The listener name.
Результат mixed Either a Horde_Notification_Listener or null.

notify() публичный Метод

Passes the message stack to all listeners and asks them to handle their messages.
public notify ( array $options = [] )
$options array An array containing display options for the listeners. Any options not contained in this list will be passed to the listeners.
listeners - (array) The list of listeners to notify.
raw - (boolean) If true, does not call the listener's notify()
      function.

push() публичный Метод

Add an event to the Horde message stack.
public push ( mixed $event, string $type = null, array $flags = [], array $options = [] )
$event mixed Horde_Notification_Event object or message string.
$type string The type of message.
$flags array Array of optional flags that will be passed to the registered listeners.
$options array Additional options:
'immediate' - (boolean) If true, immediately tries to attach to a
              listener. If no listener exists for this type, the
              message will be dropped.
              DEFAULT: false (message will be attached to available
              handler at the time notify() is called).

Описание свойств

$_decorators защищенное свойство

Decorators.
protected array $_decorators
Результат array

$_forceAttach защищенное свойство

Forces immediate attachment of a notification to a listener.
protected bool $_forceAttach
Результат boolean

$_handles защищенное свойство

Additional handle definitions.
protected array $_handles
Результат array

$_listeners защищенное свойство

Hash containing all attached listener objects.
protected array $_listeners
Результат array

$_storage защищенное свойство

The storage location where we store the messages.
protected Horde_Notification_Storage $_storage
Результат Horde_Notification_Storage