|
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
| __construct (array $params) | |
| setPartClass ($class) | |
| getPartClass () | |
| isMultipart () | |
| getContent () | |
| getSize () | |
| getPart ($num) | |
| countParts () | |
| getHeaders () | |
| getHeader ($name, $format=null) | |
| headerExists ($name) | |
| getHeaderField ($name, $wantedPart=0, $firstName=0) | |
| __get ($name) | |
| __isset ($name) | |
| __toString () | |
| hasChildren () | |
| getChildren () | |
| valid () | |
| next () | |
| key () | |
| current () | |
| rewind () | |
Protected Member Functions | |
| _cacheContent () | |
| _validateHeaders (array $headers, $assertNames=true) | |
Protected Attributes | |
| $_headers | |
| $_content | |
| $_topLines = '' | |
| $_parts = array() | |
| $_countParts | |
| $_iterationPos = 1 | |
| $_mail | |
| $_messageNum = 0 | |
| $_partClass | |
| __construct | ( | array | $params | ) |
Public constructor
Zend_Mail_Part supports different sources for content. The possible params are:
| array | $params | full message with or without headers |
| Zend_Mail_Exception |
Definition at line 120 of file Part.php.
| __get | ( | $name | ) |
Getter for mail headers - name is matched in lowercase
This getter is short for Zend_Mail_Part::getHeader($name, 'string')
| string | $name | header name |
| Zend_Mail_Exception |
Implements Zend_Mail_Part_Interface.
Definition at line 477 of file Part.php.
| __isset | ( | $name | ) |
| __toString | ( | ) |
magic method to get content of part
Implements Zend_Mail_Part_Interface.
Definition at line 502 of file Part.php.
|
protected |
Cache content and split in parts if multipart
| Zend_Mail_Exception |
Definition at line 262 of file Part.php.
|
protected |
Ensure headers do not contain invalid characters
| array | $headers | |
| bool | $assertNames |
Definition at line 588 of file Part.php.
| countParts | ( | ) |
Count parts of a multipart part
Implements Zend_Mail_Part_Interface.
Definition at line 337 of file Part.php.
| current | ( | ) |
implements Iterator::current()
Definition at line 566 of file Part.php.
| getChildren | ( | ) |
implements RecursiveIterator::getChildren()
| getContent | ( | ) |
Body of part
If part is multipart the raw content of this part with all sub parts is returned
| Zend_Mail_Exception |
Implements Zend_Mail_Part_Interface.
Definition at line 227 of file Part.php.
| getHeader | ( | $name, | |
$format = null |
|||
| ) |
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).
| 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' |
| Zend_Mail_Exception |
Implements Zend_Mail_Part_Interface.
Definition at line 393 of file Part.php.
| getHeaderField | ( | $name, | |
$wantedPart = 0, |
|||
$firstName = 0 |
|||
| ) |
Get a specific field from a header like content type or all fields as array
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.
| string | $name | name of header, like in getHeader() |
| string | $wantedPart | the wanted part, default is first, if null an array with all parts is returned |
| string | $firstName | key name for the first part |
| Zend_Exception,Zend_Mail_Exception |
Implements Zend_Mail_Part_Interface.
Definition at line 461 of file Part.php.
| getHeaders | ( | ) |
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.
Implements Zend_Mail_Part_Interface.
Definition at line 368 of file Part.php.
| getPart | ( | $num | ) |
Get part of multipart message
| int | $num | number of part starting with 1 for first part |
| Zend_Mail_Exception |
Implements Zend_Mail_Part_Interface.
Definition at line 300 of file Part.php.
| getPartClass | ( | ) |
| getSize | ( | ) |
Return size of part
Quite simple implemented currently (not decoding). Handle with care.
Implements Zend_Mail_Part_Interface.
Definition at line 251 of file Part.php.
| hasChildren | ( | ) |
implements RecursiveIterator::hasChildren()
Definition at line 512 of file Part.php.
| headerExists | ( | $name | ) |
| isMultipart | ( | ) |
Check if part is a multipart message
Implements Zend_Mail_Part_Interface.
Definition at line 209 of file Part.php.
| key | ( | ) |
| setPartClass | ( | $class | ) |
Set name pf class used to encapsulate message parts
| string | $class |
Definition at line 171 of file Part.php.
| valid | ( | ) |