XOOPS RMCommon Utilities
2.1.8.91RC
|
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 | |
Definition at line 23 of file DecoratorPlugin.php.
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().
mixed | $replacements |
Definition at line 62 of file DecoratorPlugin.php.
|
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().
Swift_Plugins_DecoratorPlugin::beforeSendPerformed | ( | Swift_Events_SendEvent | $evt | ) |
Invoked immediately before the Message is sent.
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().
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.
string | $address |
Implements Swift_Plugins_Decorator_Replacements.
Definition at line 142 of file DecoratorPlugin.php.
Referenced by beforeSendPerformed().
Swift_Plugins_DecoratorPlugin::sendPerformed | ( | Swift_Events_SendEvent | $evt | ) |
Invoked immediately after the Message is sent.
Swift_Events_SendEvent | $evt |
Implements Swift_Events_SendListener.
Definition at line 162 of file DecoratorPlugin.php.
References _restoreMessage(), and Swift_Events_SendEvent\getMessage().
|
private |
The Message that was last replaced
Definition at line 40 of file DecoratorPlugin.php.
|
private |
The body as it was before replacements
Definition at line 31 of file DecoratorPlugin.php.
|
private |
Bodies of children before they are replaced
Definition at line 37 of file DecoratorPlugin.php.
|
private |
The original subject of the message, before replacements
Definition at line 34 of file DecoratorPlugin.php.
|
private |
The replacement map
Definition at line 28 of file DecoratorPlugin.php.