Mail: ezcMailPartWalkContext
[ ]
[ Display example ] [ Mail listing example ] [ Rfcs ]
[ ]
[ ]
[ ]
[ ]
Class: ezcMailPartWalkContext
|
Use this class to create a context to be passed to the walkParts() method from ezcMail. [
source]
Example:
1. class App
2. {
3. public static function saveMailPart( $context, $mailPart )
4. {
5. // code to save the $mailPart object to disk
6. }
7. }
8.
9. // use the saveMailPart() function as a callback in walkParts()
10. // where $mail is an ezcMail object.
11. $context = new ezcMailPartWalkContext( array( 'App', 'saveMailPart' ) );
12. $context->includeDigests = true; // if you want to go through the digests in the mail
13. $mail->walkParts( $context, $mail );
Properties
|
callback |
read/write
|
$callbackFunction
Name of a function or array( 'class_name', 'function_name' ) |
|
array(string) |
read/write
|
$filter
Used to restrict processing only to the specified mail part names. If empty or null, then ezcMailText, ezcMailFile and ezcMailRfc822Digest parts are processed. Usage e.g.: array( 'ezcMailFile' ) |
|
bool |
read/write
|
$includeDigests
If true then then ezcMailRfc822Digest parts are not processed by the callback function, instead the mail parts inside the digests will be available for processing. |
|
int |
read/write
|
$level
The current level in the mail part walk (0 = first level). |
Member Variables
|
protected array(ezcMailPart) |
$parts
= array()
An array of mail parts (retrieved recursively from a mail object). |
Method Summary
|
public ezcMailPartWalkContext |
__construct(
$callbackFunction )
Constructs a new ezcMailPartWalkContext object. |
|
public void |
appendPart(
$part )
Appends a part to the list of mail parts. |
|
public array(ezcMailPart) |
getParts(
)
Returns the mail parts. |
Methods
__construct
ezcMailPartWalkContext __construct(
callback
$callbackFunction )
Constructs a new ezcMailPartWalkContext object.
The parameter $callbackFunction must be a function name as string or as array( 'class_name', 'function_name' ).
Parameters
| Name |
Type |
Description |
$callbackFunction |
callback |
|
appendPart
Appends a part to the list of mail parts.
Parameters
getParts
array(ezcMailPart) getParts(
)
Returns the mail parts.
Last updated: Wed, 28 Nov 2007