Class MachII_framework_EventContext

Description

Controls the event queue and event processing mechanism for a request/event lifecycle.

Located in /MachII/framework/EventContext.php (line 18)


	
			
Variable Summary
Method Summary
MachII_framework_EventContext MachII_framework_EventContext (MachII_framework_AppManager &$appManager)
void announceEvent (string $eventName, array &$eventArgs)
void clearEventQueue ()
void displayView (MachII_framework_Event &$event, string $viewName, string $contentKey, [boolean $append = false])
integer getEventCount ()
string getEventMapping (mixed $eventName)
integer getMaxEvents ()
void handleException (MachII_util_Exception &$exception, [boolean $clearEventQueue = true])
boolean hasCurrentEvent ()
void hasMoreEvents ()
boolean hasNextEvent ()
boolean hasPreviousEvent ()
void processEvents ()
void setCurrentEvent (MachII_framework_Event &$currentEvent)
void setEventMapping (string $eventName, string $mappingName)
void setExceptionEventName (string $exceptionEventName)
void setMaxEvents (integer $maxEvents)
void &_getEventQueue ()
void _setEventQueue (MachII_util_SizedQueue &$eventQueue)
void _setPreviousEvent (MachII_framework_Event &$previousEvent)
Variables
MachII_framework_AppManager $_appManager (line 36)
  • access: private
MachII_framework_Event $_currentEvent (line 54)
  • var: MachII_framework_Event or descendant
  • access: private
MachII_framework_EventHandler $_currentEventHandler (line 48)
  • access: private
integer $_eventCount = 0 (line 24)
  • access: private
SizedQueue $_eventQueue (line 42)
  • access: private
string $_exceptionEventName (line 66)
  • access: private
array $_mappings = array() (line 60)
  • var: associative array of event name aliases
  • access: private
integer $_maxEvents (line 72)
  • var: really it's a string from the configuration file
  • access: private
MachII_framework_Event $_previousEvent (line 78)
  • var: MachII_framework_Event or descendant
  • access: private
MachII_framework_ViewContext $_viewContext (line 30)
  • access: private
Methods
Constructor MachII_framework_EventContext (line 88)

Initalizes the event-context.

MachII_framework_EventContext MachII_framework_EventContext (MachII_framework_AppManager &$appManager)
announceEvent (line 116)

Announce an Event

Queues an event for the framework to handle. Announces an event that will cause any listeners that have registered an interest in that event to execute.

void announceEvent (string $eventName, array &$eventArgs)
  • string $eventName
  • array &$eventArgs: associative array of event arguments
clearEventMappings (line 322)
void clearEventMappings ()
clearEventQueue (line 452)

Clears the event queue.

void clearEventQueue ()
createException (line 331)
Exception &createException (Exception $e)
displayView (line 391)

Display an event's views

Executes in the following order:

  1. MachII_framework_Plugin::preView()
  2. MachII_framework_ViewContext::displayView()
  3. MachII_framework_Plugin::postView()

void displayView (MachII_framework_Event &$event, string $viewName, string $contentKey, [boolean $append = false])
getCurrentEvent (line 222)
  • return: or descendant
MachII_framework_Event &getCurrentEvent ()
getEventCount (line 463)

Returns the number of events that have been processed for this context.

integer getEventCount ()
getEventMapping (line 310)
string getEventMapping (mixed $eventName)
getExceptionEventName (line 444)
string getExceptionEventName ()
getMaxEvents (line 428)
integer getMaxEvents ()
getNextEvent (line 239)

Peeks at the next event in the queue.

MachII_framework_Event &getNextEvent ()
getPreviousEvent (line 271)

Returns the previous handled event.

  • return: MachII_framework_Event or descendant
MachII_framework_Event &getPreviousEvent ()
handleException (line 343)

Execute the registered exception event

The name of the exception event is set in the configuration file.

void handleException (MachII_util_Exception &$exception, [boolean $clearEventQueue = true])
hasCurrentEvent (line 230)
boolean hasCurrentEvent ()
hasMoreEvents (line 292)

Returns whether there is another event in the queue.

This has an alias called hasNextEvent(). return boolean

void hasMoreEvents ()
hasNextEvent (line 253)

Returns whether there is another event in the queue.

This is an alias for hasMoreEvents().

boolean hasNextEvent ()
hasPreviousEvent (line 281)

Returns whether or not getPreviousEvent() can be called to return an event.

boolean hasPreviousEvent ()
processEvents (line 158)

Process Event Queue

Begins processing of queued events. Can only be called once.

Executes in the following order:

  1. MachII_framework_Event::preProcess()
  2. MachII_framework_EventHandler::handleNextEvent()
  3. MachII_framework_Event::postProcess()

void processEvents ()
setCurrentEvent (line 214)
void setCurrentEvent (MachII_framework_Event &$currentEvent)
setEventMapping (line 302)
void setEventMapping (string $eventName, string $mappingName)
  • string $eventName
  • string $mappingName
setExceptionEventName (line 436)
void setExceptionEventName (string $exceptionEventName)
  • string $exceptionEventName
setMaxEvents (line 420)
void setMaxEvents (integer $maxEvents)
  • integer $maxEvents
_getAppManager (line 588)
  • access: private
MachII_framework_AppManager &_getAppManager ()
_getCurrentEventHandler (line 562)
  • access: private
MachII_framework_EventHandler &_getCurrentEventHandler ()
_getEventQueue (line 621)
  • access: private
void &_getEventQueue ()
_getViewContext (line 604)
MachII_framework_ViewContext &_getViewContext ()
_handleEvent (line 511)

Execute an event.

Executes in the following order:

  1. MachII_framework_Plugin::preEvent()
  2. MachII_framework_Event::preInvoke()
  3. MachII_framework_EventHandler::handleEvent()
  4. MachII_framework_Event::postInvoke()
  5. MachII_framework_Plugin::postEvent()

void _handleEvent (MachII_framework_Event &$event)
_handleNextEvent (line 477)

Execute the next event in the queue

If the event returns an error, pass it to the exception handler.

void _handleNextEvent ()
_incrementEventCount (line 570)
  • access: private
void _incrementEventCount ()
_setAppManager (line 579)
  • access: private
void _setAppManager (MachII_framework_AppManager &$appManager)
_setCurrentEventHandler (line 553)
  • access: private
void _setCurrentEventHandler (MachII_framework_EventHandler &$currentEventHandler)
_setEventQueue (line 613)
  • access: private
void _setEventQueue (MachII_util_SizedQueue &$eventQueue)
_setPreviousEvent (line 262)
  • access: private
void _setPreviousEvent (MachII_framework_Event &$previousEvent)
_setViewContext (line 596)
void _setViewContext (MachII_framework_ViewContext &$viewContext)

Documentation generated on Thu, 20 Jan 2005 10:46:58 -0800 by phpDocumentor 1.3.0RC3