ez components / documentation / api reference / 2007.1.1 / mail

eZ Components 2007.1.1

Mail: ezcMailPartWalkContext

[ Tutorial ] [ Display example ] [ Mail listing example ] [ Rfcs ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcMailPartWalkContext

Use this class to create a context to be passed to the walkParts() method from ezcMail. [source]
 1.  class App
 2.  {
 3.      public static function saveMailPart$context$mailPart )
 4.      {
 5.          // code to save the $mailPart object to disk
 6.      }
 7.  }
 9.  // use the saveMailPart() function as a callback in walkParts()
10.  // where $mail is an ezcMail object.
11.   $context new ezcMailPartWalkContextarray'App''saveMailPart' ) );
12.  $context->includeDigests true// if you want to go through the digests in the mail
13.   $mail->walkParts$context$mail );


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.



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' ).


Name Type Description
$callbackFunction callback  


void appendPart( ezcMailPart $part )
Appends a part to the list of mail parts.


Name Type Description
$part ezcMailPart  


array(ezcMailPart) getParts( )
Returns the mail parts.

Last updated: Wed, 28 Nov 2007