Class Swift_Mime_SimpleMimeEntity

InheritanceSwift_Mime_SimpleMimeEntity
ImplementsSwift_Mime_MimeEntity
SubclassesSwift_Attachment, Swift_EmbeddedFile, Swift_Image, Swift_Message, Swift_MimePart, Swift_Mime_Attachment, Swift_Mime_EmbeddedFile, Swift_Mime_MimePart, Swift_Mime_SimpleMessage, Swift_SignedMessage

A MIME entity, in a multipart message.

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$_userContentType Swift_Mime_SimpleMimeEntity

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__clone() Make a deep copy of object. Swift_Mime_SimpleMimeEntity
__construct() Create a new SimpleMimeEntity with $headers, $encoder and $cache. Swift_Mime_SimpleMimeEntity
__destruct() Empties it's own contents from the cache. Swift_Mime_SimpleMimeEntity
__toString() Returns a string representation of this object. Swift_Mime_SimpleMimeEntity
charsetChanged() Receive notification that the charset of this entity, or a parent entity has changed. Swift_Mime_SimpleMimeEntity
encoderChanged() Receive notification that the encoder of this entity or a parent entity has changed. Swift_Mime_SimpleMimeEntity
generateId() Generate a new Content-ID or Message-ID for this MIME entity. Swift_Mime_SimpleMimeEntity
getBody() Get the body of this entity as a string. Swift_Mime_SimpleMimeEntity
getBoundary() Get the boundary used to separate children in this entity. Swift_Mime_SimpleMimeEntity
getChildren() Get all children added to this entity. Swift_Mime_SimpleMimeEntity
getContentType() Get the Content-type of this entity. Swift_Mime_SimpleMimeEntity
getDescription() Get the description of this entity. Swift_Mime_SimpleMimeEntity
getEncoder() Get the encoder used for the body of this entity. Swift_Mime_SimpleMimeEntity
getHeaders() Get the {@link Swift_Mime_HeaderSet} for this entity. Swift_Mime_SimpleMimeEntity
getId() Get the CID of this entity. Swift_Mime_SimpleMimeEntity
getMaxLineLength() Get the maximum line length of the body of this entity. Swift_Mime_SimpleMimeEntity
getNestingLevel() Get the nesting level of this entity. Swift_Mime_SimpleMimeEntity
setBody() Set the body of this entity, either as a string, or as an instance of {@link Swift_OutputByteStream}. Swift_Mime_SimpleMimeEntity
setBoundary() Set the boundary used to separate children in this entity. Swift_Mime_SimpleMimeEntity
setChildren() Set all children of this entity. Swift_Mime_SimpleMimeEntity
setContentType() Set the Content-type of this entity. Swift_Mime_SimpleMimeEntity
setDescription() Set the description of this entity. Swift_Mime_SimpleMimeEntity
setEncoder() Set the encoder used for the body of this entity. Swift_Mime_SimpleMimeEntity
setId() Set the CID of this entity. Swift_Mime_SimpleMimeEntity
setMaxLineLength() Set the maximum line length of lines in this body. Swift_Mime_SimpleMimeEntity
toByteStream() Write this entire entity to a {@see Swift_InputByteStream}. Swift_Mime_SimpleMimeEntity
toString() Get this entire entity as a string. Swift_Mime_SimpleMimeEntity

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
_bodyToByteStream() Write this entire entity to a {@link Swift_InputByteStream}. Swift_Mime_SimpleMimeEntity
_bodyToString() Get this entire entity as a string. Swift_Mime_SimpleMimeEntity
_clearCache() Empty the KeyCache for this entity. Swift_Mime_SimpleMimeEntity
_fixHeaders() Re-evaluate what content type and encoding should be used on this entity. Swift_Mime_SimpleMimeEntity
_getCache() Get the KeyCache used in this entity. Swift_Mime_SimpleMimeEntity
_getGrammar() Get the grammar used for validation. Swift_Mime_SimpleMimeEntity
_getHeaderFieldModel() Get the model data (usually an array or a string) for $field. Swift_Mime_SimpleMimeEntity
_getHeaderParameter() Get the parameter value of $parameter on $field header. Swift_Mime_SimpleMimeEntity
_getIdField() Get the name of the header that provides the ID of this entity. Swift_Mime_SimpleMimeEntity
_setHeaderFieldModel() Set the model data for $field. Swift_Mime_SimpleMimeEntity
_setHeaderParameter() Set the parameter value of $parameter on $field header. Swift_Mime_SimpleMimeEntity
getRandomId() Returns a random Content-ID or Message-ID. Swift_Mime_SimpleMimeEntity

Property Details

$_userContentType protected property
protected $_userContentType null

Method Details

__clone() public method

Make a deep copy of object.

public void __clone ( )
__construct() public method

Create a new SimpleMimeEntity with $headers, $encoder and $cache.

public void __construct ( Swift_Mime_HeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache, Swift_Mime_Grammar $grammar )
$headers Swift_Mime_HeaderSet
$encoder Swift_Mime_ContentEncoder
$cache Swift_KeyCache
$grammar Swift_Mime_Grammar
__destruct() public method

Empties it's own contents from the cache.

public void __destruct ( )
__toString() public method

Returns a string representation of this object.

See also toString().

public string __toString ( )
_bodyToByteStream() protected method

Write this entire entity to a {@link Swift_InputByteStream}.

protected void _bodyToByteStream ( Swift_InputByteStream $is )
$is
_bodyToString() protected method

Get this entire entity as a string.

protected string _bodyToString ( )
_clearCache() protected method

Empty the KeyCache for this entity.

protected void _clearCache ( )
_fixHeaders() protected method

Re-evaluate what content type and encoding should be used on this entity.

protected void _fixHeaders ( )
_getCache() protected method

Get the KeyCache used in this entity.

protected Swift_KeyCache _getCache ( )
_getGrammar() protected method

Get the grammar used for validation.

protected Swift_Mime_Grammar _getGrammar ( )
_getHeaderFieldModel() protected method

Get the model data (usually an array or a string) for $field.

protected void _getHeaderFieldModel ( $field )
$field
_getHeaderParameter() protected method

Get the parameter value of $parameter on $field header.

protected void _getHeaderParameter ( $field, $parameter )
$field
$parameter
_getIdField() protected method

Get the name of the header that provides the ID of this entity.

protected void _getIdField ( )
_setHeaderFieldModel() protected method

Set the model data for $field.

protected void _setHeaderFieldModel ( $field, $model )
$field
$model
_setHeaderParameter() protected method

Set the parameter value of $parameter on $field header.

protected void _setHeaderParameter ( $field, $parameter, $value )
$field
$parameter
$value
charsetChanged() public method

Receive notification that the charset of this entity, or a parent entity has changed.

public void charsetChanged ( $charset )
$charset string
encoderChanged() public method

Receive notification that the encoder of this entity or a parent entity has changed.

public void encoderChanged ( Swift_Mime_ContentEncoder $encoder )
$encoder Swift_Mime_ContentEncoder
generateId() public method

Generate a new Content-ID or Message-ID for this MIME entity.

public string generateId ( )
getBody() public method

Get the body of this entity as a string.

public string getBody ( )
getBoundary() public method

Get the boundary used to separate children in this entity.

public string getBoundary ( )
getChildren() public method

Get all children added to this entity.

public Swift_Mime_MimeEntity[] getChildren ( )
getContentType() public method

Get the Content-type of this entity.

public string getContentType ( )
getDescription() public method

Get the description of this entity.

This value comes from the Content-Description header if set.

public string getDescription ( )
getEncoder() public method

Get the encoder used for the body of this entity.

public Swift_Mime_ContentEncoder getEncoder ( )
getHeaders() public method

Get the {@link Swift_Mime_HeaderSet} for this entity.

public Swift_Mime_HeaderSet getHeaders ( )
getId() public method

Get the CID of this entity.

The CID will only be present in headers if a Content-ID header is present.

public string getId ( )
getMaxLineLength() public method

Get the maximum line length of the body of this entity.

public int getMaxLineLength ( )
getNestingLevel() public method

Get the nesting level of this entity.

See also [[LEVEL_TOP,]] LEVEL_MIXED, LEVEL_RELATED, LEVEL_ALTERNATIVE.

public int getNestingLevel ( )
getRandomId() protected method

Returns a random Content-ID or Message-ID.

protected string getRandomId ( )
setBody() public method

Set the body of this entity, either as a string, or as an instance of {@link Swift_OutputByteStream}.

public Swift_Mime_SimpleMimeEntity setBody ( $body, $contentType null )
$body mixed
$contentType string

Optional

setBoundary() public method

Set the boundary used to separate children in this entity.

public Swift_Mime_SimpleMimeEntity setBoundary ( $boundary )
$boundary string
throws Swift_RfcComplianceException
setChildren() public method

Set all children of this entity.

public Swift_Mime_SimpleMimeEntity setChildren ( array $children, $compoundLevel null )
$children Swift_Mime_MimeEntity[]
$compoundLevel int

For internal use only

setContentType() public method

Set the Content-type of this entity.

public Swift_Mime_SimpleMimeEntity setContentType ( $type )
$type string
setDescription() public method

Set the description of this entity.

This method sets a value in the Content-ID header.

public Swift_Mime_SimpleMimeEntity setDescription ( $description )
$description string
setEncoder() public method

Set the encoder used for the body of this entity.

public Swift_Mime_SimpleMimeEntity setEncoder ( Swift_Mime_ContentEncoder $encoder )
$encoder Swift_Mime_ContentEncoder
setId() public method

Set the CID of this entity.

public Swift_Mime_SimpleMimeEntity setId ( $id )
$id string
setMaxLineLength() public method

Set the maximum line length of lines in this body.

Though not enforced by the library, lines should not exceed 1000 chars.

public Swift_Mime_SimpleMimeEntity setMaxLineLength ( $length )
$length int
toByteStream() public method

Write this entire entity to a {@see Swift_InputByteStream}.

public void toByteStream ( Swift_InputByteStream $is )
$is
toString() public method

Get this entire entity as a string.

public string toString ( )