A MIME entity, such as an attachment.

package Swift
subpackage Mime
author Chris Corbyn

 Methods

Notify this observer that the entity's charset has changed.

charsetChanged(string $charset) 
Inherited
inherited_from \Swift_Mime_CharsetObserver::charsetChanged()

Parameters

$charset

string

Get the body content of this entity as a string.

getBody() : string

Returns NULL if no body has been set.

Returns

string

Get all children nested inside this entity.

getChildren() : \Swift_Mime_MimeEntity[]

These are not just the immediate children, but all children.

Returns

Get the qualified content-type of this mime entity.

getContentType() : string

Returns

string

Get the collection of Headers in this Mime entity.

getHeaders() : \Swift_Mime_Header[]

Returns a unique ID for this entity.

getId() : string

For most entities this will likely be the Content-ID, though it has no explicit semantic meaning and can be considered an identifier for programming logic purposes. If a Content-ID header is present, this value SHOULD match the value of the header.

Returns

string

Get the level at which this entity shall be nested in final document.

getNestingLevel() : int

The lower the value, the more outermost the entity will be nested.

see LEVEL_MIXED, LEVEL_RELATED, LEVEL_ALTERNATIVE

Returns

int

Set the body content of this entity as a string.

setBody(string $body, string $contentType) 

Parameters

$body

string

$contentType

string

optional

Set all children nested inside this entity.

setChildren(array $children) 

This includes grandchildren.

Parameters

Get this entire entity as a ByteStream.

toByteStream(\Swift_InputByteStream $is) 

Parameters

$is

\Swift_InputByteStream

to write to

Get this entire entity in its string form.

toString() : string

Returns

string

 Constants

 

An entity which nests with the same precedence as a mime part

LEVEL_ALTERNATIVE 
 

An entity which nests with the same precedence as an attachment

LEVEL_MIXED 
   

Main message document; there can only be one of these

LEVEL_TOP