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

Public Member Functions

 __construct ($replacements)
 
 beforeSendPerformed (Swift_Events_SendEvent $evt)
 
 getReplacementsFor ($address)
 
 sendPerformed (Swift_Events_SendEvent $evt)
 

Private Member Functions

 _restoreMessage (Swift_Mime_Message $message)
 

Private Attributes

 $_lastMessage
 
 $_orginalBody
 
 $_originalChildBodies = array()
 
 $_originalSubject
 
 $_replacements
 

Detailed Description

Definition at line 23 of file DecoratorPlugin.php.

Constructor & Destructor Documentation

Swift_Plugins_DecoratorPlugin::__construct (   $replacements)

Create a new DecoratorPlugin with $replacements.

The $replacements can either be an associative array, or an implementation of Swift_Plugins_Decorator_Replacements.

When using an array, it should be of the form: $replacements = array( "address1@domain.tld" => array("{a}" => "b", "{c}" => "d"), "address2@domain.tld" => array("{a}" => "x", "{c}" => "y") )

When using an instance of Swift_Plugins_Decorator_Replacements, the object should return just the array of replacements for the address given to Swift_Plugins_Decorator_Replacements::getReplacementsFor().

Parameters
mixed$replacements

Definition at line 62 of file DecoratorPlugin.php.

Member Function Documentation

Swift_Plugins_DecoratorPlugin::_restoreMessage ( Swift_Mime_Message  $message)
private

Restore a changed message back to its original state

Definition at line 170 of file DecoratorPlugin.php.

References $id, Swift_Mime_MimeEntity\getChildren(), Swift_Mime_MimeEntity\setBody(), and Swift_Mime_Message\setSubject().

Referenced by beforeSendPerformed(), and sendPerformed().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Plugins_DecoratorPlugin::beforeSendPerformed ( Swift_Events_SendEvent  $evt)

Invoked immediately before the Message is sent.

Parameters
Swift_Events_SendEvent$evt

Implements Swift_Events_SendListener.

Definition at line 79 of file DecoratorPlugin.php.

References $type, _restoreMessage(), Swift_Events_SendEvent\getMessage(), and getReplacementsFor().

Here is the call graph for this function:

Swift_Plugins_DecoratorPlugin::getReplacementsFor (   $address)

Find a map of replacements for the address.

If this plugin was provided with a delegate instance of Swift_Plugins_Decorator_Replacements then the call will be delegated to it. Otherwise, it will attempt to find the replacements from the array provided in the constructor.

If no replacements can be found, an empty value (NULL) is returned.

Parameters
string$address
Returns
array

Implements Swift_Plugins_Decorator_Replacements.

Definition at line 142 of file DecoratorPlugin.php.

Referenced by beforeSendPerformed().

Here is the caller graph for this function:

Swift_Plugins_DecoratorPlugin::sendPerformed ( Swift_Events_SendEvent  $evt)

Invoked immediately after the Message is sent.

Parameters
Swift_Events_SendEvent$evt

Implements Swift_Events_SendListener.

Definition at line 162 of file DecoratorPlugin.php.

References _restoreMessage(), and Swift_Events_SendEvent\getMessage().

Here is the call graph for this function:

Member Data Documentation

Swift_Plugins_DecoratorPlugin::$_lastMessage
private

The Message that was last replaced

Definition at line 40 of file DecoratorPlugin.php.

Swift_Plugins_DecoratorPlugin::$_orginalBody
private

The body as it was before replacements

Definition at line 31 of file DecoratorPlugin.php.

Swift_Plugins_DecoratorPlugin::$_originalChildBodies = array()
private

Bodies of children before they are replaced

Definition at line 37 of file DecoratorPlugin.php.

Swift_Plugins_DecoratorPlugin::$_originalSubject
private

The original subject of the message, before replacements

Definition at line 34 of file DecoratorPlugin.php.

Swift_Plugins_DecoratorPlugin::$_replacements
private

The replacement map

Definition at line 28 of file DecoratorPlugin.php.


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