Mail/Message/File.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Mail
- Version
- $Id: File.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Mail_Message_File
- Implements
- \Zend_Mail_Message_Interface
- Parent(s)
- \Zend_Mail_Part_File < \Zend_Mail_Part
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties

null|string $_content =
- Type
- null | string
- Inherited_from
- \Zend_Mail_Part::$$_content
- Inherited_from
- \Zend_Mail_Part_File::$$_content

$_contentPos = array()array()Details- Type
- n/a
- Inherited_from
- \Zend_Mail_Part_File::$$_contentPos

null|int $_countParts = count of parts of a multipart message
Inherited from: \Zend_Mail_Part::$$_countParts\Zend_Mail_Part_File::$$_countParts- Type
- null | int
- Inherited_from
- \Zend_Mail_Part::$$_countParts
- Inherited_from
- \Zend_Mail_Part_File::$$_countParts

$_fh = - Type
- n/a
- Inherited_from
- \Zend_Mail_Part_File::$$_fh

null|array $_headers = headers of part as array
Inherited from: \Zend_Mail_Part::$$_headers\Zend_Mail_Part_File::$$_headers- Type
- null | array
- Inherited_from
- \Zend_Mail_Part::$$_headers
- Inherited_from
- \Zend_Mail_Part_File::$$_headers

int $_iterationPos = 1current position of iterator
Inherited from: \Zend_Mail_Part::$$_iterationPos\Zend_Mail_Part_File::$$_iterationPos1Details- Type
- int
- Inherited_from
- \Zend_Mail_Part::$$_iterationPos
- Inherited_from
- \Zend_Mail_Part_File::$$_iterationPos

null|\Zend_Mail_Storage_Abstract $_mail = mail handler, if late fetch is active
Inherited from: \Zend_Mail_Part::$$_mail\Zend_Mail_Part_File::$$_mail- Type
- null | \Zend_Mail_Storage_Abstract
- Inherited_from
- \Zend_Mail_Part::$$_mail
- Inherited_from
- \Zend_Mail_Part_File::$$_mail

int $_messageNum = 0message number for mail handler
Inherited from: \Zend_Mail_Part::$$_messageNum\Zend_Mail_Part_File::$$_messageNum0Details- Type
- int
- Inherited_from
- \Zend_Mail_Part::$$_messageNum
- Inherited_from
- \Zend_Mail_Part_File::$$_messageNum

string $_partClass = Class to use when creating message parts
Inherited from: \Zend_Mail_Part::$$_partClass\Zend_Mail_Part_File::$$_partClass- Type
- string
- Inherited_from
- \Zend_Mail_Part::$$_partClass
- Inherited_from
- \Zend_Mail_Part_File::$$_partClass

$_partPos = array()array()Details- Type
- n/a
- Inherited_from
- \Zend_Mail_Part_File::$$_partPos

array $_parts = array()parts of multipart message
Inherited from: \Zend_Mail_Part::$$_parts\Zend_Mail_Part_File::$$_partsarray()Details- Type
- array
- Inherited_from
- \Zend_Mail_Part::$$_parts
- Inherited_from
- \Zend_Mail_Part_File::$$_parts

string $_topLines = ''toplines as fetched with headers
Inherited from: \Zend_Mail_Part::$$_topLines\Zend_Mail_Part_File::$$_topLines''Details- Type
- string
- Inherited_from
- \Zend_Mail_Part::$$_topLines
- Inherited_from
- \Zend_Mail_Part_File::$$_topLines
Methods

__construct( $params) : voidPublic constructor
In addition to the parameters of Zend_Mail_Part::__construct() this constructor supports: - flags array with flags for message, keys are ignored, use constants defined in Zend_Mail_Storage
| Name | Type | Description |
|---|---|---|
| $params |
| Exception | Description |
|---|---|
| \Zend_Mail_Exception |

__get(string $name) : stringGetter for mail headers - name is matched in lowercase
Inherited from: \Zend_Mail_Part::__get()\Zend_Mail_Part_File::__get()This getter is short for Zend_Mail_Part::getHeader($name, 'string')
| Name | Type | Description |
|---|---|---|
| $name | string | header name |
| Type | Description |
|---|---|
| string | value of header |
| Exception | Description |
|---|---|
| \Zend_Mail_Exception |
- See
- \global\Zend_Mail_Part::getHeader()

__isset( $name) : booleanIsset magic method proxy to hasHeader
Inherited from: \Zend_Mail_Part::__isset()\Zend_Mail_Part_File::__isset()This method is short syntax for Zend_Mail_Part::hasHeader($name);
| Name | Type | Description |
|---|---|---|
| $name | string |
| Type | Description |
|---|---|
| boolean |
- See
- \global\Zend_Mail_Part::hasHeader

__toString() : stringmagic method to get content of part
Inherited from: \Zend_Mail_Part::__toString()\Zend_Mail_Part_File::__toString()| Type | Description |
|---|---|
| string | content |

_cacheContent() : nullCache content and split in parts if multipart
Inherited from: \Zend_Mail_Part::_cacheContent()\Zend_Mail_Part_File::_cacheContent()| Type | Description |
|---|---|
| null |
| Exception | Description |
|---|---|
| \Zend_Mail_Exception |

countParts() : intCount parts of a multipart part
Inherited from: \Zend_Mail_Part::countParts()\Zend_Mail_Part_File::countParts()| Type | Description |
|---|---|
| int | number of sub-parts |

current() : \Zend_Mail_Partimplements Iterator::current()
Inherited from: \Zend_Mail_Part::current()\Zend_Mail_Part_File::current()| Type | Description |
|---|---|
| \Zend_Mail_Part | current part |

getChildren() : \Zend_Mail_Partimplements RecursiveIterator::getChildren()
Inherited from: \Zend_Mail_Part::getChildren()\Zend_Mail_Part_File::getChildren()| Type | Description |
|---|---|
| \Zend_Mail_Part | same as self::current() |

getContent( $stream = null) : string
If part is multipart the raw content of this part with all sub parts is returned
| Name | Type | Description |
|---|---|---|
| $stream |
| Type | Description |
|---|---|
| string | body |
| Exception | Description |
|---|---|
| \Zend_Mail_Exception |

getFlags() : arrayget all set flags
| Type | Description |
|---|---|
| array | array with flags, key and value are the same for easy lookup |

getHeader(string $name, string $format = null) : string | arrayGet a header in specificed format
Inherited from: \Zend_Mail_Part::getHeader()\Zend_Mail_Part_File::getHeader()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).
| Name | Type | Description |
|---|---|---|
| $name | string | name of header, matches case-insensitive, but camel-case is replaced with dashes |
| $format | string | change type of return value to 'string' or 'array' |
| Type | Description |
|---|---|
| string | array | value of header in wanted or internal format |
| Exception | Description |
|---|---|
| \Zend_Mail_Exception |

getHeaderField(string $name, string $wantedPart = 0, string $firstName = 0) : string | arrayGet a specific field from a header like content type or all fields as array
Inherited from: \Zend_Mail_Part::getHeaderField()\Zend_Mail_Part_File::getHeaderField()If the header occurs more than once, only the value from the first header is returned.
Throws a Zend_Mail_Exception if the requested header does not exist. If the specific header field does not exist, returns null.
| Name | Type | Description |
|---|---|---|
| $name | string | name of header, like in getHeader() |
| $wantedPart | string | the wanted part, default is first, if null an array with all parts is returned |
| $firstName | string | key name for the first part |
| Type | Description |
|---|---|
| string | array | wanted part or all parts as array($firstName => firstPart, partname => value) |
| Exception | Description |
|---|---|
| \Zend_Exception, | Zend_Mail_Exception |

getHeaders() : arrayGet all headers
Inherited from: \Zend_Mail_Part::getHeaders()\Zend_Mail_Part_File::getHeaders()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.
| Type | Description |
|---|---|
| array | headers as array(name => value) |

getPart(int $num) : \Zend_Mail_Part
| Name | Type | Description |
|---|---|---|
| $num | int | number of part starting with 1 for first part |
| Type | Description |
|---|---|
| \Zend_Mail_Part | wanted part |
| Exception | Description |
|---|---|
| \Zend_Mail_Exception |

getPartClass() : stringRetrieve the class name used to encapsulate message parts
Inherited from: \Zend_Mail_Part::getPartClass()\Zend_Mail_Part_File::getPartClass()| Type | Description |
|---|---|
| string |

getSize() : int
Quite simple implemented currently (not decoding). Handle with care.
| Type | Description |
|---|---|
| int | size |

getTopLines() : stringreturn toplines as found after headers
| Type | Description |
|---|---|
| string | toplines |

hasChildren() : boolimplements RecursiveIterator::hasChildren()
Inherited from: \Zend_Mail_Part::hasChildren()\Zend_Mail_Part_File::hasChildren()| Type | Description |
|---|---|
| bool | current element has children/is multipart |

hasFlag(mixed $flag) : boolcheck if flag is set
| Name | Type | Description |
|---|---|---|
| $flag | mixed | a flag name, use constants defined in Zend_Mail_Storage |
| Type | Description |
|---|---|
| bool | true if set, otherwise false |

headerExists(string $name) : booleanCheck wheater the Mail part has a specific header.
Inherited from: \Zend_Mail_Part::headerExists()\Zend_Mail_Part_File::headerExists()| Name | Type | Description |
|---|---|---|
| $name | string |
| Type | Description |
|---|---|
| boolean |

isMultipart() : boolCheck if part is a multipart message
Inherited from: \Zend_Mail_Part::isMultipart()\Zend_Mail_Part_File::isMultipart()| Type | Description |
|---|---|
| bool | if part is multipart |

key() : stringimplements Iterator::key()
Inherited from: \Zend_Mail_Part::key()\Zend_Mail_Part_File::key()| Type | Description |
|---|---|
| string | key/number of current part |

next() : nullimplements Iterator::next()
Inherited from: \Zend_Mail_Part::next()\Zend_Mail_Part_File::next()| Type | Description |
|---|---|
| null |

rewind() : nullimplements Iterator::rewind()
Inherited from: \Zend_Mail_Part::rewind()\Zend_Mail_Part_File::rewind()| Type | Description |
|---|---|
| null |

setPartClass(string $class) : \Zend_Mail_PartSet name pf class used to encapsulate message parts
Inherited from: \Zend_Mail_Part::setPartClass()\Zend_Mail_Part_File::setPartClass()| Name | Type | Description |
|---|---|---|
| $class | string |
| Type | Description |
|---|---|
| \Zend_Mail_Part |

valid() : boolimplements Iterator::valid()
Inherited from: \Zend_Mail_Part::valid()\Zend_Mail_Part_File::valid()| Type | Description |
|---|---|
| bool | check if there's a current element |