Zeta Components - high quality PHP components

Zeta Components Manual :: Docs For Class ezcMailPartWalkContext

Mail::ezcMailPartWalkContext

Class ezcMailPartWalkContext

Use this class to create a context to be passed to the walkParts() method from ezcMail.

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 );

Source for this file: /Mail/src/structs/walk_context.php

Version:   //autogentag//

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

void appendPart( ezcMailPart $part )

Appends a part to the list of mail parts.

Parameters:
Name Type Description
$part ezcMailPart

getParts

array(ezcMailPart) getParts( )

Returns the mail parts.

Documentation generated by phpDocumentor 1.4.3