TYPO3  7.6
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Swift_Events_SimpleEventDispatcher Class Reference
Inheritance diagram for Swift_Events_SimpleEventDispatcher:
Swift_Events_EventDispatcher

Public Member Functions

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

Private Member Functions

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

Private Attributes

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

Detailed Description

The EventDispatcher which handles the event dispatching layer.

Author
Chris Corbyn

Definition at line 16 of file SimpleEventDispatcher.php.

Constructor & Destructor Documentation

__construct ( )

Create a new EventDispatcher.

Definition at line 30 of file SimpleEventDispatcher.php.

Member Function Documentation

_bubble ( Swift_Events_EventObject  $evt,
  $target 
)
private

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

Definition at line 149 of file SimpleEventDispatcher.php.

References Swift_Events_EventObject\bubbleCancelled().

Referenced by dispatchEvent().

_prepareBubbleQueue ( Swift_Events_EventObject  $evt)
private

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

Definition at line 136 of file SimpleEventDispatcher.php.

Referenced by dispatchEvent().

bindEventListener ( Swift_Events_EventListener  $listener)

Bind an event listener to this dispatcher.

Parameters
Swift_Events_EventListener$listener

Implements Swift_Events_EventDispatcher.

Definition at line 112 of file SimpleEventDispatcher.php.

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 63 of file SimpleEventDispatcher.php.

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

Create a new ResponseEvent for $source and $response.

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

Implements Swift_Events_EventDispatcher.

Definition at line 77 of file SimpleEventDispatcher.php.

References $response.

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 49 of file SimpleEventDispatcher.php.

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 89 of file SimpleEventDispatcher.php.

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 102 of file SimpleEventDispatcher.php.

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 129 of file SimpleEventDispatcher.php.

References _bubble(), and _prepareBubbleQueue().

Member Data Documentation

$_bubbleQueue = array()
private

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

Definition at line 25 of file SimpleEventDispatcher.php.

$_eventMap = array()
private

A map of event types to their associated listener types

Definition at line 19 of file SimpleEventDispatcher.php.

$_listeners = array()
private

Event listeners bound to this dispatcher

Definition at line 22 of file SimpleEventDispatcher.php.