category Zend
package Zend_Mail
subpackage Storage

 Methods

Public constructor

__construct(array $params) 

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

Parameters

$params

array

Exceptions

\Zend\Mail\Storage\Exception\ExceptionInterface

Getter for mail headers - name is matched in lowercase

__get(string $name) : string
Inherited

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

see \Zend\Mail\Storage\Part::getHeader()
inherited_from \Zend\Mail\Storage\Part::__get()
inherited_from \Zend\Mail\Storage\Part\File::__get()

Parameters

$name

string

header name

Exceptions

\Zend\Mail\Storage\Exception\ExceptionInterface

Returns

stringvalue of header

Isset magic method proxy to hasHeader

__isset($name) : bool
Inherited

This method is short syntax for Part::hasHeader($name);

see \Zend\Mail\Storage\Part::hasHeader
inherited_from \Zend\Mail\Storage\Part::__isset()
inherited_from \Zend\Mail\Storage\Part\File::__isset()

Parameters

$name

string

Returns

bool

magic method to get content of part

__toString() : string
Inherited

inherited_from \Zend\Mail\Storage\Part::__toString()
inherited_from \Zend\Mail\Storage\Part\File::__toString()

Returns

stringcontent

Count parts of a multipart part

countParts() : int
Inherited

inherited_from \Zend\Mail\Storage\Part::countParts()
inherited_from \Zend\Mail\Storage\Part\File::countParts()

Returns

intnumber of sub-parts

implements Iterator::current()

current() : \Zend\Mail\Storage\Part
Inherited

inherited_from \Zend\Mail\Storage\Part::current()
inherited_from \Zend\Mail\Storage\Part\File::current()

Returns

implements RecursiveIterator::getChildren()

getChildren() : \Zend\Mail\Storage\Part
Inherited

inherited_from \Zend\Mail\Storage\Part::getChildren()
inherited_from \Zend\Mail\Storage\Part\File::getChildren()

Returns

\Zend\Mail\Storage\Partsame as self::current()

Body of part

getContent(resource $stream) : string
Inherited

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

inherited_from \Zend\Mail\Storage\Part\File::getContent()

Parameters

$stream

resource

Optional

Exceptions

\Zend\Mail\Storage\Exception\RuntimeException

Returns

stringbody

get all set flags

getFlags() : array

Returns

arrayarray with flags, key and value are the same for easy lookup

Get a header in specified format

getHeader(string $name, string $format) : string | array | \Zend\Mail\Header\HeaderInterface | \ArrayIterator
Inherited

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 Mime::LINEEND as delim).

inherited_from \Zend\Mail\Storage\Part::getHeader()
inherited_from \Zend\Mail\Storage\Part\File::getHeader()

Parameters

$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'

Exceptions

\Zend\Mail\Storage\Exception\InvalidArgumentException

Returns

stringarray\Zend\Mail\Header\HeaderInterface\ArrayIteratorvalue of header in wanted or internal format

Get a specific field from a header like content type or all fields as array

getHeaderField(string $name, string $wantedPart, string $firstName) : string | array
Inherited

If the header occurs more than once, only the value from the first header is returned.

Throws an Exception if the requested header does not exist. If the specific header field does not exist, returns null.

inherited_from \Zend\Mail\Storage\Part::getHeaderField()
inherited_from \Zend\Mail\Storage\Part\File::getHeaderField()

Parameters

$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

Exceptions

\Zend\Mime\Exception\RuntimeException

Returns

stringarraywanted part or all parts as array($firstName => firstPart, partname => value)

Access headers collection

getHeaders() : \Zend\Mail\Headers
Inherited

Lazy-loads if not already attached.

inherited_from \Zend\Mail\Storage\Part::getHeaders()
inherited_from \Zend\Mail\Storage\Part\File::getHeaders()

Returns

Get part of multipart message

getPart(int $num) : \Zend\Mail\Storage\Part
Inherited

inherited_from \Zend\Mail\Storage\Part\File::getPart()

Parameters

$num

int

number of part starting with 1 for first part

Exceptions

\Zend\Mail\Storage\Part\Exception\RuntimeException

Returns

Return size of part

getSize() : int
Inherited

Quite simple implemented currently (not decoding). Handle with care.

inherited_from \Zend\Mail\Storage\Part\File::getSize()

Returns

intsize

return toplines as found after headers

getTopLines() : string

Returns

stringtoplines

implements RecursiveIterator::hasChildren()

hasChildren() : bool
Inherited

inherited_from \Zend\Mail\Storage\Part::hasChildren()
inherited_from \Zend\Mail\Storage\Part\File::hasChildren()

Returns

boolcurrent element has children/is multipart

check if flag is set

hasFlag(mixed $flag) : bool

Parameters

$flag

mixed

a flag name, use constants defined in \Zend\Mail\Storage

Returns

booltrue if set, otherwise false

Check if part is a multipart message

isMultipart() : bool
Inherited

inherited_from \Zend\Mail\Storage\Part::isMultipart()
inherited_from \Zend\Mail\Storage\Part\File::isMultipart()

Returns

boolif part is multipart

implements Iterator::key()

key() : string
Inherited

inherited_from \Zend\Mail\Storage\Part::key()
inherited_from \Zend\Mail\Storage\Part\File::key()

Returns

stringkey/number of current part

implements Iterator::rewind()

rewind() 
Inherited

inherited_from \Zend\Mail\Storage\Part::rewind()
inherited_from \Zend\Mail\Storage\Part\File::rewind()

implements Iterator::valid()

valid() : bool
Inherited

inherited_from \Zend\Mail\Storage\Part::valid()
inherited_from \Zend\Mail\Storage\Part\File::valid()

Returns

boolcheck if there's a current element

Cache content and split in parts if multipart

_cacheContent() : null
Inherited

inherited_from \Zend\Mail\Storage\Part::_cacheContent()
inherited_from \Zend\Mail\Storage\Part\File::_cacheContent()

Exceptions

\Zend\Mail\Storage\Exception\RuntimeException

Returns

null

 Properties

 

raw part body

$content : null | string
Inherited

inherited_from \Zend\Mail\Storage\Part::$$content
inherited_from \Zend\Mail\Storage\Part\File::$$content
 

$contentPos

$contentPos 
Inherited

inherited_from \Zend\Mail\Storage\Part\File::$$contentPos
 

count of parts of a multipart message

$countParts : null | int
Inherited

inherited_from \Zend\Mail\Storage\Part::$$countParts
inherited_from \Zend\Mail\Storage\Part\File::$$countParts
 

$fh

$fh 
Inherited

inherited_from \Zend\Mail\Storage\Part\File::$$fh
 

flags for this message

$flags : array

 

Headers of the part

$headers : \Zend\Mail\Headers | null
Inherited

inherited_from \Zend\Mail\Storage\Part::$$headers
inherited_from \Zend\Mail\Storage\Part\File::$$headers
 

current position of iterator

$iterationPos : int
Inherited

inherited_from \Zend\Mail\Storage\Part::$$iterationPos
inherited_from \Zend\Mail\Storage\Part\File::$$iterationPos
 

mail handler, if late fetch is active

$mail : null | \Zend\Mail\Storage\AbstractStorage
Inherited

inherited_from \Zend\Mail\Storage\Part::$$mail
inherited_from \Zend\Mail\Storage\Part\File::$$mail
 

message number for mail handler

$messageNum : int
Inherited

inherited_from \Zend\Mail\Storage\Part::$$messageNum
inherited_from \Zend\Mail\Storage\Part\File::$$messageNum
 

$partPos

$partPos 
Inherited

inherited_from \Zend\Mail\Storage\Part\File::$$partPos
 

parts of multipart message

$parts : array
Inherited

inherited_from \Zend\Mail\Storage\Part::$$parts
inherited_from \Zend\Mail\Storage\Part\File::$$parts
 

toplines as fetched with headers

$topLines : string
Inherited

inherited_from \Zend\Mail\Storage\Part::$$topLines
inherited_from \Zend\Mail\Storage\Part\File::$$topLines