Mail/Part/File.php

Show: PublicProtectedPrivateinherited
Table of Contents
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-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_Part_File

Package: Zend\Mail
Parent(s)
\Zend_Mail_Part
Children
\Zend_Mail_Message_File
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprotectednull|string $_content
inherited
raw part body
Inherited from: \Zend_Mail_Part::$$_content
Details
Type
null | string
Inherited_from
\Zend_Mail_Part::$$_content  
>VPropertyprotected$_contentPos = array()
Default valuearray()Details
Type
n/a
>VPropertyprotectednull|int $_countParts
inherited
count of parts of a multipart message
Inherited from: \Zend_Mail_Part::$$_countParts
Details
Type
null | int
Inherited_from
\Zend_Mail_Part::$$_countParts  
>VPropertyprotected$_fh
Details
Type
n/a
>VPropertyprotectednull|array $_headers
inherited
headers of part as array
Inherited from: \Zend_Mail_Part::$$_headers
Details
Type
null | array
Inherited_from
\Zend_Mail_Part::$$_headers  
>VPropertyprotectedint $_iterationPos = 1
inherited
current position of iterator
Inherited from: \Zend_Mail_Part::$$_iterationPos
Default value1Details
Type
int
Inherited_from
\Zend_Mail_Part::$$_iterationPos  
>VPropertyprotectednull|\Zend_Mail_Storage_Abstract $_mail
inherited
mail handler, if late fetch is active
Inherited from: \Zend_Mail_Part::$$_mail
Details
Type
null | \Zend_Mail_Storage_Abstract
Inherited_from
\Zend_Mail_Part::$$_mail  
>VPropertyprotectedint $_messageNum = 0
inherited
message number for mail handler
Inherited from: \Zend_Mail_Part::$$_messageNum
Default value0Details
Type
int
Inherited_from
\Zend_Mail_Part::$$_messageNum  
>VPropertyprotectedstring $_partClass
inherited
Class to use when creating message parts
Inherited from: \Zend_Mail_Part::$$_partClass
Details
Type
string
Inherited_from
\Zend_Mail_Part::$$_partClass  
>VPropertyprotected$_partPos = array()
Default valuearray()Details
Type
n/a
>VPropertyprotectedarray $_parts = array()
inherited
parts of multipart message
Inherited from: \Zend_Mail_Part::$$_parts
Default valuearray()Details
Type
array
Inherited_from
\Zend_Mail_Part::$$_parts  
>VPropertyprotectedstring $_topLines = ''
inherited
toplines as fetched with headers
Inherited from: \Zend_Mail_Part::$$_topLines
Default value''Details
Type
string
Inherited_from
\Zend_Mail_Part::$$_topLines  

Methods

methodpublic__construct(array $params) : void

Public constructor

This handler supports the following params: - file filename or open file handler with message content (required) - startPos start position of message or part in file (default: current position) - endPos end position of message or part in file (default: end of file)

Parameters
NameTypeDescription
$paramsarray

full message with or without headers

Throws
ExceptionDescription
\Zend_Mail_Exception
methodpublic__get(string $name) : string
inherited

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
NameTypeDescription
$namestring

header name

Returns
TypeDescription
stringvalue of header
Throws
ExceptionDescription
\Zend_Mail_Exception
Details
See
\Zend_Mail_Part::getHeader()  
methodpublic__isset(string $name) : boolean
inherited

Isset magic method proxy to hasHeader

Inherited from: \Zend_Mail_Part::__isset()

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

Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
boolean
Details
See
\Zend_Mail_Part::hasHeader  
methodpublic__toString() : string
inherited

magic method to get content of part

Inherited from: \Zend_Mail_Part::__toString()
Returns
TypeDescription
stringcontent
methodprotected_cacheContent() : null
inherited

Cache content and split in parts if multipart

Inherited from: \Zend_Mail_Part::_cacheContent()
Returns
TypeDescription
null
Throws
ExceptionDescription
\Zend_Mail_Exception
methodpubliccountParts() : int
inherited

Count parts of a multipart part

Inherited from: \Zend_Mail_Part::countParts()
Returns
TypeDescription
intnumber of sub-parts
methodpubliccurrent() : \Zend_Mail_Part
inherited

implements Iterator::current()

Inherited from: \Zend_Mail_Part::current()
Returns
TypeDescription
\Zend_Mail_Partcurrent part
methodpublicgetChildren() : \Zend_Mail_Part
inherited

implements RecursiveIterator::getChildren()

Inherited from: \Zend_Mail_Part::getChildren()
Returns
TypeDescription
\Zend_Mail_Partsame as self::current()
methodpublicgetContent( $stream = null) : string

Body of part

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

Parameters
NameTypeDescription
$stream
Returns
TypeDescription
stringbody
Throws
ExceptionDescription
\Zend_Mail_Exception
methodpublicgetHeader(string $name, string $format = null) : string | array
inherited

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
NameTypeDescription
$namestring

name of header, matches case-insensitive, but camel-case is replaced with dashes

$formatstring

change type of return value to 'string' or 'array'

Returns
TypeDescription
string | arrayvalue of header in wanted or internal format
Throws
ExceptionDescription
\Zend_Mail_Exception
methodpublicgetHeaderField(string $name, string $wantedPart = 0, string $firstName = 0) : string | array
inherited

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
NameTypeDescription
$namestring

name of header, like in getHeader()

$wantedPartstring

the wanted part, default is first, if null an array with all parts is returned

$firstNamestring

key name for the first part

Returns
TypeDescription
string | arraywanted part or all parts as array($firstName => firstPart, partname => value)
Throws
ExceptionDescription
\Zend_Exception,Zend_Mail_Exception
methodpublicgetHeaders() : array
inherited

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
TypeDescription
arrayheaders as array(name => value)
methodpublicgetPart(int $num) : \Zend_Mail_Part

Get part of multipart message

Parameters
NameTypeDescription
$numint

number of part starting with 1 for first part

Returns
TypeDescription
\Zend_Mail_Partwanted part
Throws
ExceptionDescription
\Zend_Mail_Exception
methodpublicgetPartClass() : string
inherited

Retrieve the class name used to encapsulate message parts

Inherited from: \Zend_Mail_Part::getPartClass()
Returns
TypeDescription
string
methodpublicgetSize() : int

Return size of part

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

Returns
TypeDescription
intsize
methodpublichasChildren() : bool
inherited

implements RecursiveIterator::hasChildren()

Inherited from: \Zend_Mail_Part::hasChildren()
Returns
TypeDescription
boolcurrent element has children/is multipart
methodpublicheaderExists(string $name) : boolean
inherited

Check wheater the Mail part has a specific header.

Inherited from: \Zend_Mail_Part::headerExists()
Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
boolean
methodpublicisMultipart() : bool
inherited

Check if part is a multipart message

Inherited from: \Zend_Mail_Part::isMultipart()
Returns
TypeDescription
boolif part is multipart
methodpublickey() : string
inherited

implements Iterator::key()

Inherited from: \Zend_Mail_Part::key()
Returns
TypeDescription
stringkey/number of current part
methodpublicnext() : null
inherited

implements Iterator::next()

Inherited from: \Zend_Mail_Part::next()
Returns
TypeDescription
null
methodpublicrewind() : null
inherited

implements Iterator::rewind()

Inherited from: \Zend_Mail_Part::rewind()
Returns
TypeDescription
null
methodpublicsetPartClass(string $class) : \Zend_Mail_Part
inherited

Set name pf class used to encapsulate message parts

Inherited from: \Zend_Mail_Part::setPartClass()
Parameters
NameTypeDescription
$classstring
Returns
TypeDescription
\Zend_Mail_Part
methodpublicvalid() : bool
inherited

implements Iterator::valid()

Inherited from: \Zend_Mail_Part::valid()
Returns
TypeDescription
boolcheck if there's a current element
Documentation was generated by phpDocumentor 2.0.0a12.