Class Zend_Mail_Part

Description

Implements interfaces:

  • RecursiveIterator (internal interface)

Located in /Mail/Part.php (line 36)


	
			
Direct descendents
Class Description
 class Zend_Mail_Message
Variable Summary
Method Summary
 Zend_Mail_Part __construct ( $params)
 int countParts ()
 string getContent ()
 string|array getHeader (string $name, [string $format = null])
 array getHeaders ()
 Zend_Mail_Part getPart (int $num)
 bool hasChildren ()
 bool isMultipart ()
 string key ()
 null next ()
 null rewind ()
 bool valid ()
 null _cacheContent ()
 string __get (string $name)
 string __toString ()
Variables
null|string $_content (line 48)

raw part body

  • access: protected
null|int $_countParts (line 66)

count of parts of a multipart message

  • access: protected
null|array $_headers (line 42)

headers of part as array

  • access: protected
int $_iterationPos = 1 (line 72)

current position of iterator

  • access: protected
null|Zend_Mail_Storage_Abstract $_mail (line 78)

mail handler, if late fetch is active

  • access: protected
int $_messageNum = 0 (line 84)

message number for mail handler

  • access: protected
array $_parts = array() (line 60)

parts of multipart message

  • access: protected
string $_topLines = '' (line 54)

toplines as fetched with headers

  • access: protected
Methods
Constructor __construct (line 99)

Public constructor

Zend_Mail_Part supports different sources for content. The possible params are:

  • handler a instance of Zend_Mail_Storage_Abstract for late fetch
  • id number of message for handler
  • raw raw content with header and body as string
  • headers headers as array (name => value) or string, if a content part is found it's used as toplines
  • noToplines ignore content found after headers in param 'headers'
  • content content as string

  • access: public
Zend_Mail_Part __construct ( $params)
  • array $params: full message with or without headers

Redefined in descendants as:
countParts (line 232)

Count parts of a multipart part

  • return: number of sub-parts
  • access: public
int countParts ()
current (line 407)

implements Iterator::current()

  • return: current part
  • access: public
Zend_Mail_Part current ()

Implementation of:
RecursiveIterator::current
getChildren (line 364)

implements RecursiveIterator::getChildren()

  • return: same as self::current()
  • access: public
Zend_Mail_Part getChildren ()

Implementation of:
RecursiveIterator::getChildren
getContent (line 154)

Body of part

If part is multipart the raw content of this part with all sub parts is returned

  • return: body
  • throws: Zend_Mail_Exception
  • access: public
string getContent ()
getHeader (line 288)

Get a header in specificed format

Internally headers that occur more than once are saved as array, all other as string. If $format is set to string implode is used to concat the values (with Zend_Mime::LINEEND as delim).

  • return: value of header in wanted or internal format
  • throws: Zend_Mail_Exception
  • access: public
string|array getHeader (string $name, [string $format = null])
  • string $name: name of header, matches case-insensitive, but camel-case is replaced with dashes
  • string $format: change type of return value to 'string' or 'array'
getHeaders (line 263)

Get all headers

The returned headers are as saved internally. All names are lowercased. The value is a string or an array if a header with the same name occurs more than once.

  • return: headers as array(name => value)
  • access: public
array getHeaders ()
getPart (line 203)

Get part of multipart message

  • return: wanted part
  • throws: Zend_Mail_Exception
  • access: public
Zend_Mail_Part getPart (int $num)
  • int $num: number of part starting with 1 for first part
hasChildren (line 353)

implements RecursiveIterator::hasChildren()

  • return: current element has children/is multipart
  • access: public
bool hasChildren ()

Implementation of:
RecursiveIterator::hasChildren
isMultipart (line 136)

Check if part is a multipart message

  • return: if part is multipart
  • access: public
bool isMultipart ()
key (line 397)

implements Iterator::key()

  • return: key/number of current part
  • access: public
string key ()

Implementation of:
RecursiveIterator::key
next (line 387)

implements Iterator::next()

  • access: public
null next ()

Implementation of:
RecursiveIterator::next
rewind (line 417)

implements Iterator::rewind()

  • access: public
null rewind ()

Implementation of:
RecursiveIterator::rewind
valid (line 374)

implements Iterator::valid()

  • return: check if there's a current element
  • access: public
bool valid ()

Implementation of:
RecursiveIterator::valid
_cacheContent (line 173)

Cache content and split in parts if multipart

  • throws: Zend_Mail_Exception
  • access: protected
null _cacheContent ()
__get (line 333)

Getter for mail headers - name is matched in lowercase

This getter is short for Zend_Mail_Part::getHeader($name, 'string')

string __get (string $name)
  • string $name: header name
__toString (line 343)

magic method to get content of part

  • return: content
  • access: public
string __toString ()

Documentation generated on Sun, 27 May 2007 23:26:30 -0700 by phpDocumentor 1.3.2