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)


	
			
Method Summary
MachII_framework_EventContext __construct (MachII_framework_AppManager $appManager)
void announceEvent (string $eventName, array $eventArgs)
void clearEventQueue ()
Exception createException (Exception $e)
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 _handleEvent (MachII_framework_Event $event)
void _setAppManager (MachII_framework_AppManager $appManager)
void _setCurrentEventHandler (MachII_framework_EventHandler $currentEventHandler)
void _setEventQueue (MachII_util_SizedQueue $eventQueue)
void _setPreviousEvent (MachII_framework_Event $previousEvent)
void _setViewContext (MachII_framework_ViewContext $viewContext)
Methods
Constructor __construct (line 88)

Initalizes the event-context.

MachII_framework_EventContext __construct (MachII_framework_AppManager $appManager)
announceEvent (line 110)

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 293)
void clearEventMappings ()
clearEventQueue (line 408)

Clears the event queue.

void clearEventQueue ()
createException (line 302)
Exception createException (Exception $e)
  • Exception $e
displayView (line 359)

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 197)
  • return: or descendant
MachII_framework_Event getCurrentEvent ()
getEventCount (line 418)

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

integer getEventCount ()
getEventMapping (line 281)
string getEventMapping (mixed $eventName)
getExceptionEventName (line 400)
string getExceptionEventName ()
getMaxEvents (line 384)
integer getMaxEvents ()
getNextEvent (line 214)

Peeks at the next event in the queue.

MachII_framework_Event getNextEvent ()
getPreviousEvent (line 243)

Returns the previous handled event.

  • return: MachII_framework_Event or descendant
MachII_framework_Event getPreviousEvent ()
handleException (line 314)

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 205)
boolean hasCurrentEvent ()
hasMoreEvents (line 264)

Returns whether there is another event in the queue.

This has an alias called hasNextEvent(). return boolean

void hasMoreEvents ()
hasNextEvent (line 225)

Returns whether there is another event in the queue.

This is an alias for hasMoreEvents().

boolean hasNextEvent ()
hasPreviousEvent (line 253)

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

boolean hasPreviousEvent ()
processEvents (line 143)

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 189)
void setCurrentEvent (MachII_framework_Event $currentEvent)
setEventMapping (line 273)
void setEventMapping (string $eventName, string $mappingName)
  • string $eventName
  • string $mappingName
setExceptionEventName (line 392)
void setExceptionEventName (string $exceptionEventName)
  • string $exceptionEventName
setMaxEvents (line 376)
void setMaxEvents (integer $maxEvents)
  • integer $maxEvents
_getAppManager (line 533)
  • access: private
MachII_framework_AppManager _getAppManager ()
_getCurrentEventHandler (line 507)
  • access: private
MachII_framework_EventHandler _getCurrentEventHandler ()
_getEventQueue (line 566)
  • access: private
void _getEventQueue ()
_getViewContext (line 549)
MachII_framework_ViewContext _getViewContext ()
_handleEvent (line 465)

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 432)

Execute the next event in the queue

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

void _handleNextEvent ()
_incrementEventCount (line 515)
  • access: private
void _incrementEventCount ()
_setAppManager (line 524)
  • access: private
void _setAppManager (MachII_framework_AppManager $appManager)
_setCurrentEventHandler (line 498)
  • access: private
void _setCurrentEventHandler (MachII_framework_EventHandler $currentEventHandler)
_setEventQueue (line 558)
  • access: private
void _setEventQueue (MachII_util_SizedQueue $eventQueue)
_setPreviousEvent (line 234)
  • access: private
void _setPreviousEvent (MachII_framework_Event $previousEvent)
_setViewContext (line 541)
void _setViewContext (MachII_framework_ViewContext $viewContext)

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