Public constructor
Part supports different sources for content. The possible params are: - handler an instance of AbstractStorage for late fetch - id number of message for handler - raw raw content with header and body as string - headers headers as array (name => value) or string, if a content part is found it’s used as toplines - noToplines ignore content found after headers in param ‘headers’ - content content as string - strict strictly parse raw content
Parameters: | array – full message with or without headers |
---|---|
Throws ExceptionInvalidArgumentException: | |
Check if part is a multipart message
Return type: | bool if part is multipart |
---|
Body of part
If part is multipart the raw content of this part with all sub parts is returned
Return type: | string body |
---|
Return size of part
Quite simple implemented currently (not decoding). Handle with care.
Return type: | int size |
---|
Cache content and split in parts if multipart
Return type: | null |
---|
Get part of multipart message
Parameters: | int – number of part starting with 1 for first part |
---|---|
Throws ExceptionRuntimeException: | |
Return type: | Part wanted part |
Count parts of a multipart part
Return type: | int number of sub-parts |
---|
Access headers collection
Lazy-loads if not already attached.
Return type: | Headers |
---|
Get a header in specified 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 Mime::LINEEND as delim).
Parameters: |
|
---|---|
Throws ExceptionInvalidArgumentException: | |
Return type: | string|array|HeaderInterface|ArrayIterator value of header in wanted or internal format |
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 an Exception if the requested header does not exist. If the specific header field does not exist, returns null.
Parameters: |
|
---|---|
Return type: | string|array wanted part or all parts as array($firstName => firstPart, partname => value) |
Throws : | ZendMimeExceptionRuntimeException |
Getter for mail headers - name is matched in lowercase
This getter is short for Part::getHeader($name, ‘string’)
Parameters: | string – header name |
---|---|
Return type: | string value of header |
Throws : | ExceptionExceptionInterface |
Isset magic method proxy to hasHeader
This method is short syntax for Part::hasHeader($name);
Parameters: | string – |
---|---|
Return type: | bool |
magic method to get content of part
Return type: | string content |
---|
implements RecursiveIterator::hasChildren()
Return type: | bool current element has children/is multipart |
---|
implements RecursiveIterator::getChildren()
Return type: | Part same as self::current() |
---|
implements Iterator::valid()
Return type: | bool check if there’s a current element |
---|
implements Iterator::next()
implements Iterator::key()
Return type: | string key/number of current part |
---|
implements Iterator::current()
Return type: | Part current part |
---|
implements Iterator::rewind()