Class Notification

Description

The Notification:: class provides a subject-observer pattern for raising and showing messages of different types and to different listeners.

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Located in /Notification/Notification.php (line 25)


	
			
Variable Summary
Method Summary
 Notification Notification ([string $stack = 'hordeMessageStacks'])
 void &attach (string $listener, [array $params = array()], [string $class = null])
 integer count ([string $my_listener = null])
 void detach ( $listener, string $listner)
 void notify ([array $options = array()])
 void push (mixed $event, [integer $type = null], [array $flags = array()])
 Notification &singleton ([string $stack = 'hordeMessageStacks'])
Variables
Horde_Alarm $_alarm (line 46)

A Horde_Alarm instance.

array $_listeners = array() (line 32)

Hash containing all attached listener objects.

string $_stack = 'hordeMessageStacks' (line 39)

The name of the session variable where we store the messages.

Methods
Constructor Notification (line 77)

Initialize the notification system, set up any needed session variables, etc. Should never be called except by &Notification::singleton();

Notification Notification ([string $stack = 'hordeMessageStacks'])
  • string $stack: The name of the message stack to use.
attach (line 110)

Registers a listener with the notification object and includes the necessary library file dynamically.

void &attach (string $listener, [array $params = array()], [string $class = null])
  • string $listener: The name of the listener to attach. These names must be unique; further listeners with the same name will be ignored.
  • array $params: A hash containing any additional configuration or connection parameters a listener driver might need.
  • string $class: 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.
count (line 228)

Return the number of notification messages in the stack.

integer count ([string $my_listener = null])
  • string $my_listener: The name of the listener.
detach (line 137)

Remove a listener from the notification list.

void detach ( $listener, string $listner)
  • string $listner: The name of the listener to detach.
  • $listener
notify (line 200)

Passes the message stack to all listeners and asks them to handle their messages.

void notify ([array $options = array()])
  • array $options: An array containing display options for the listeners.
push (line 164)

Add an event to the Horde message stack.

The event type parameter should begin with 'horde.' unless the application defines its own Notification_Listener subclass that handles additional codes.

void push (mixed $event, [integer $type = null], [array $flags = array()])
  • mixed $event: Notification_Event object or message string.
  • integer $type: The type of message: 'horde.error', 'horde.warning', 'horde.success', or 'horde.message'.
  • array $flags: Array of optional flags that will be passed to the registered listeners.
singleton (line 59)

Returns a reference to the global Notification object, only creating it if it doesn't already exist.

This method must be invoked as: $notification = &Notification::singleton()

  • return: The Horde Notification instance.
Notification &singleton ([string $stack = 'hordeMessageStacks'])
  • string $stack: The name of the message stack to use.

Documentation generated on Sun, 30 Jan 2011 05:20:00 +0000 by phpDocumentor 1.4.3