Package: plugin

Class Erfurt_EventDispatcher





Description

Erfurt Event Dispatcher Provides functionality to announce methods/functions to named events, announced methods will be started when the event is triggered. Methods can be ranked in position.

  • author: Michael Haschke
  • version: $Id: EventDispatcher.php 1928 2008-02-27 17:16:37Z haschek $
Variable Summary
mixed $eventTraceState
Method Summary
Erfurt_EventDispatcher __construct ( $o)
Bool announce (String $eventname, String $functionname, [Array $position = array()] )
Mixed isAnnounced (String $eventname, Mixed $nameOrPosition)
Array listAnnounced (String $eventname)
Mixed reannounce ( $eventname,  $functionname, [ $position = array()] )
Bool trigger (String $eventname,  &$attribute, Pointer $attribute)
Variables
$eventTraceState = array()
mixed $eventTraceState = array()
  • access: public
Methods
Constructor __construct
Erfurt_EventDispatcher __construct ( $o )
  • access: public
Parameters:
  • $o
announce
Bool announce ( String $eventname , String $functionname , [ Array $position = array() ] )

Erfurt_EventDispatcher::announce() announce a function to a named event

  • return: o true: function was added to event
    • false: function was not added to event
  • access: public
Parameters:
  • String $eventname : name of triggered event
  • String $functionname : name of function/method which should be started when event is triggered
  • Array $position : info about ranking, array may contain one to three elements:
    • pos: integer
    • before: string or array of more strings with function names which should be started after announced function
    • after: string or array of more strings with function names which should be started before announced function
isAnnounced
Mixed isAnnounced ( String $eventname , Mixed $nameOrPosition )

Erfurt_EventDispatcher::isAnnounced()

  • return: o false: function is not added to event or position is not occupied
    • string: function which is set to the position
    • numeric: position of function
  • access: public
Parameters:
  • String $eventname : name of triggered event
  • Mixed $nameOrPosition : function name or position id
    • function name must be a string
    • position must be numeric
listAnnounced
Array listAnnounced ( String $eventname )

Erfurt_EventDispatcher::listAnnounced()

  • return: sorted list of all functions which are added to a named event
    • key: functionname
    • value: position
  • access: public
Parameters:
  • String $eventname : name of triggered event
reannounce
Mixed reannounce ( $eventname , $functionname , [ $position = array() ] )

Erfurt_EventDispatcher::reannounce() re-announce a function to a named event, parameters are exact the same like at announce(). Reannouncements only work with already announced functions.

  • return: o true: function was added to event
    • false: function was not added to event
    • null: function was not announced before
  • access: public
Parameters:
  • $eventname
  • $functionname
  • $position
trigger
Bool trigger ( String $eventname , &$attribute , Pointer $attribute )

Erfurt_EventDispatcher::trigger()

  • return: response
    • true: all started methods did return true
    • false: at least as one started method returned false
  • access: public
Parameters:
  • String $eventname : name of triggered event
  • Pointer $attribute : Pointer to one var
  • &$attribute

Documentation generated on 2009-01-06 at 01:01 by phpDocumentor 1.4.1