XOOPS RMCommon Utilities  2.1.8.91RC
 All Classes Namespaces Files Functions Variables
Swift_Events_SimpleEventDispatcher Class Reference
Inheritance diagram for Swift_Events_SimpleEventDispatcher:
Inheritance graph

Public Member Functions

 __construct ()
 
 bindEventListener (Swift_Events_EventListener $listener)
 
 createCommandEvent (Swift_Transport $source, $command, $successCodes=array())
 
 createResponseEvent (Swift_Transport $source, $response, $valid)
 
 createSendEvent (Swift_Transport $source, Swift_Mime_Message $message)
 
 createTransportChangeEvent (Swift_Transport $source)
 
 createTransportExceptionEvent (Swift_Transport $source, Swift_TransportException $ex)
 
 dispatchEvent (Swift_Events_EventObject $evt, $target)
 

Private Member Functions

 _bubble (Swift_Events_EventObject $evt, $target)
 
 _prepareBubbleQueue (Swift_Events_EventObject $evt)
 

Private Attributes

 $_bubbleQueue = array()
 
 $_eventMap = array()
 
 $_listeners = array()
 

Detailed Description

Definition at line 27 of file SimpleEventDispatcher.php.

Constructor & Destructor Documentation

Swift_Events_SimpleEventDispatcher::__construct ( )

Create a new EventDispatcher.

Definition at line 42 of file SimpleEventDispatcher.php.

Member Function Documentation

Swift_Events_SimpleEventDispatcher::_bubble ( Swift_Events_EventObject  $evt,
  $target 
)
private

Bubble $evt up the stack calling $target() on each listener

Definition at line 166 of file SimpleEventDispatcher.php.

References $target, and Swift_Events_EventObject\bubbleCancelled().

Referenced by dispatchEvent().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Events_SimpleEventDispatcher::_prepareBubbleQueue ( Swift_Events_EventObject  $evt)
private

Queue listeners on a stack ready for $evt to be bubbled up it

Definition at line 151 of file SimpleEventDispatcher.php.

Referenced by dispatchEvent().

Here is the caller graph for this function:

Swift_Events_SimpleEventDispatcher::bindEventListener ( Swift_Events_EventListener  $listener)

Bind an event listener to this dispatcher.

Parameters
Swift_Events_EventListener$listener

Implements Swift_Events_EventDispatcher.

Definition at line 123 of file SimpleEventDispatcher.php.

Swift_Events_SimpleEventDispatcher::createCommandEvent ( Swift_Transport  $source,
  $command,
  $successCodes = array() 
)

Create a new CommandEvent for $source and $command.

Parameters
Swift_Transport$source
string$commandThat will be executed
array$successCodesThat are needed
Returns
Swift_Events_CommandEvent

Implements Swift_Events_EventDispatcher.

Definition at line 74 of file SimpleEventDispatcher.php.

Swift_Events_SimpleEventDispatcher::createResponseEvent ( Swift_Transport  $source,
  $response,
  $valid 
)

Create a new ResponseEvent for $source and $response.

Parameters
Swift_Transport$source
string$response
boolean$validIf the response is valid
Returns
Swift_Events_ResponseEvent

Implements Swift_Events_EventDispatcher.

Definition at line 88 of file SimpleEventDispatcher.php.

Swift_Events_SimpleEventDispatcher::createSendEvent ( Swift_Transport  $source,
Swift_Mime_Message  $message 
)

Create a new SendEvent for $source and $message.

Parameters
Swift_Transport$source
Swift_Mime_Message
Returns
Swift_Events_SendEvent

Implements Swift_Events_EventDispatcher.

Definition at line 60 of file SimpleEventDispatcher.php.

Swift_Events_SimpleEventDispatcher::createTransportChangeEvent ( Swift_Transport  $source)

Create a new TransportChangeEvent for $source.

Parameters
Swift_Transport$source
Returns
Swift_Events_TransportChangeEvent

Implements Swift_Events_EventDispatcher.

Definition at line 100 of file SimpleEventDispatcher.php.

Swift_Events_SimpleEventDispatcher::createTransportExceptionEvent ( Swift_Transport  $source,
Swift_TransportException  $ex 
)

Create a new TransportExceptionEvent for $source.

Parameters
Swift_Transport$source
Swift_TransportException$ex
Returns
Swift_Events_TransportExceptionEvent

Implements Swift_Events_EventDispatcher.

Definition at line 112 of file SimpleEventDispatcher.php.

Swift_Events_SimpleEventDispatcher::dispatchEvent ( Swift_Events_EventObject  $evt,
  $target 
)

Dispatch the given Event to all suitable listeners.

Parameters
Swift_Events_EventObject$evt
string$targetmethod

Implements Swift_Events_EventDispatcher.

Definition at line 142 of file SimpleEventDispatcher.php.

References $target, _bubble(), and _prepareBubbleQueue().

Here is the call graph for this function:

Member Data Documentation

Swift_Events_SimpleEventDispatcher::$_bubbleQueue = array()
private

Listeners queued to have an Event bubbled up the stack to them

Definition at line 37 of file SimpleEventDispatcher.php.

Swift_Events_SimpleEventDispatcher::$_eventMap = array()
private

A map of event types to their associated listener types

Definition at line 31 of file SimpleEventDispatcher.php.

Swift_Events_SimpleEventDispatcher::$_listeners = array()
private

Event listeners bound to this dispatcher

Definition at line 34 of file SimpleEventDispatcher.php.


The documentation for this class was generated from the following file: