Apache Zeta Components Manual :: File Source for walk_context.php
Source for file walk_context.php
Documentation is available at walk_context.php
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @version //autogentag//
* Use this class to create a context to be passed to the walkParts() method from ezcMail.
* public static function saveMailPart( $context, $mailPart )
* // code to save the $mailPart object to disk
* // use the saveMailPart() function as a callback in walkParts()
* // where $mail is an ezcMail object.
* $context = new ezcMailPartWalkContext( array( 'App', 'saveMailPart' ) );
* $context->includeDigests = true; // if you want to go through the digests in the mail
* $mail->walkParts( $context, $mail );
* @property array(string) $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' )
* @property callback $callbackFunction
* Name of a function or array( 'class_name', 'function_name' )
* @property bool $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.
* The current level in the mail part walk (0 = first level).
* @version //autogentag//
* An array of mail parts (retrieved recursively from a mail object).
* @var array(ezcMailPart)
* Holds the properties of this class.
* @var array(string=>mixed)
private $properties =
array();
* Constructs a new ezcMailPartWalkContext object.
* The parameter $callbackFunction must be a function name as string or as
* array( 'class_name', 'function_name' ).
* @param callback $callbackFunction
$this->callbackFunction =
$callbackFunction;
$this->includeDigests =
false;
* Sets the property $name to $value.
* @throws ezcBasePropertyNotFoundException
* if the property $name does not exist
* @throws ezcBaseValueException
* if $value is not appropiate for property $name
public function __set( $name, $value )
$this->properties[$name] = (int)
$value;
$this->properties[$name] = (bool)
$value;
$this->properties[$name] =
$value;
$this->properties[$name] =
$value;
* Returns the value of the property $name.
* @throws ezcBasePropertyNotFoundException
* if the property $name does not exist
public function __get( $name )
return $this->properties[$name];
* Returns true if the property $name is set, otherwise false.
public function __isset( $name )
return isset
( $this->properties[$name] );
* Appends a part to the list of mail parts.
* @param ezcMailPart $part
* Returns the mail parts.
* @return array(ezcMailPart)