PHP 클래스 Horde_Notification_Handler, horde

저자: Jan Schneider ([email protected])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_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