API Documentation

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 license@zend.com so we can send you a copy immediately.

category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Mail  
version
$Id: File.php 23775 2011-03-01 17:25:24Z ralph $  

\Zend_Mail_Message_File

Extends from
\Zend_Mail_Part_File
Implements
\Zend_Mail_Message_Interface
category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Mail  

Properties

Propertyprotectedarray  $_flags= 'array'

flags for this message

Default valuearrayDetails
Type
array

Methods

methodpublic__construct(  $params ) : void

Public 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

Parameters
Name Type Description
$params
Throws
Exception Description
\Zend_Mail_Exception
methodpublic__get( string $name ) : string

Getter for mail headers - name is matched in lowercase

Inherited from: \Zend_Mail_Part::__get()

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

Parameters
Name Type Description
$name string header name
Returns
Type Description
string value of header
Throws
Exception Description
\Zend_Mail_Exception
Details
see
\Zend_Mail_Part::getHeader()  
methodpublic__isset(  $name ) : boolean

Isset magic method proxy to hasHeader

Inherited from: \Zend_Mail_Part::__isset()

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

Parameters
Name Type Description
$name string
Returns
Type Description
boolean
Details
see
\Zend_Mail_Part::hasHeader  
methodpublic__toString( ) : string

magic method to get content of part

Inherited from: \Zend_Mail_Part::__toString()
Returns
Type Description
string content
methodprotected_cacheContent( ) : null

Cache content and split in parts if multipart

Inherited from: \Zend_Mail_Part::_cacheContent()
Returns
Type Description
null
Throws
Exception Description
\Zend_Mail_Exception
methodpubliccountParts( ) : int

Count parts of a multipart part

Inherited from: \Zend_Mail_Part::countParts()
Returns
Type Description
int number of sub-parts
methodpubliccurrent( ) : \Zend_Mail_Part

implements Iterator::current()

Inherited from: \Zend_Mail_Part::current()
Returns
Type Description
\Zend_Mail_Part current part
methodpublicgetChildren( ) : \Zend_Mail_Part

implements RecursiveIterator::getChildren()

Inherited from: \Zend_Mail_Part::getChildren()
Returns
Type Description
\Zend_Mail_Part same as self::current()
methodpublicgetContent(  $stream = null ) : string

Body of part

Inherited from: \Zend_Mail_Part_File::getContent()

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

Parameters
Name Type Description
$stream
Returns
Type Description
string body
Throws
Exception Description
\Zend_Mail_Exception
methodpublicgetFlags( ) : array

get all set flags

Returns
Type Description
array array with flags, key and value are the same for easy lookup
methodpublicgetHeader( string $name, string $format = null ) : string|array

Get a header in specificed format

Inherited from: \Zend_Mail_Part::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).

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

Returns
Type Description
stringarray value of header in wanted or internal format
Throws
Exception Description
\Zend_Mail_Exception
methodpublicgetHeaderField( string $name, string $wantedPart = 0, string $firstName = 0 ) : string|array

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

Inherited from: \Zend_Mail_Part::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.

Parameters
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
Returns
Type Description
stringarray wanted part or all parts as array($firstName => firstPart, partname => value)
Throws
Exception Description
\Zend_Exception, Zend_Mail_Exception
methodpublicgetHeaders( ) : array

Get all headers

Inherited from: \Zend_Mail_Part::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.

Returns
Type Description
array headers as array(name => value)
methodpublicgetPart( int $num ) : \Zend_Mail_Part

Get part of multipart message

Inherited from: \Zend_Mail_Part_File::getPart()
Parameters
Name Type Description
$num int number of part starting with 1 for first part
Returns
Type Description
\Zend_Mail_Part wanted part
Throws
Exception Description
\Zend_Mail_Exception
methodpublicgetSize( ) : int

Return size of part

Inherited from: \Zend_Mail_Part_File::getSize()

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

Returns
Type Description
int size
methodpublicgetTopLines( ) : string

return toplines as found after headers

Returns
Type Description
string toplines
methodpublichasChildren( ) : bool

implements RecursiveIterator::hasChildren()

Inherited from: \Zend_Mail_Part::hasChildren()
Returns
Type Description
bool current element has children/is multipart
methodpublichasFlag( mixed $flag ) : bool

check if flag is set

Parameters
Name Type Description
$flag mixed a flag name, use constants defined in Zend_Mail_Storage
Returns
Type Description
bool true if set, otherwise false
methodpublicheaderExists( string $name ) : boolean

Check wheater the Mail part has a specific header.

Inherited from: \Zend_Mail_Part::headerExists()
Parameters
Name Type Description
$name string
Returns
Type Description
boolean
methodpublicisMultipart( ) : bool

Check if part is a multipart message

Inherited from: \Zend_Mail_Part::isMultipart()
Returns
Type Description
bool if part is multipart
methodpublickey( ) : string

implements Iterator::key()

Inherited from: \Zend_Mail_Part::key()
Returns
Type Description
string key/number of current part
methodpublicnext( ) : null

implements Iterator::next()

Inherited from: \Zend_Mail_Part::next()
Returns
Type Description
null
methodpublicrewind( ) : null

implements Iterator::rewind()

Inherited from: \Zend_Mail_Part::rewind()
Returns
Type Description
null
methodpublicvalid( ) : bool

implements Iterator::valid()

Inherited from: \Zend_Mail_Part::valid()
Returns
Type Description
bool check if there's a current element
Documentation was generated by DocBlox 0.13.3.