A MIME part, in a multipart message.

package Swift
subpackage Mime
author Chris Corbyn

 Methods

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

__construct(\Swift_Mime_HeaderSet $headers, \Swift_Mime_ContentEncoder $encoder, \Swift_KeyCache $cache, \Swift_Mime_Grammar $grammar, string $charset) 

Parameters

$charset

string

Empties it's own contents from the cache.

__destruct() 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::__destruct()

Returns a string representation of this object.

__toString() : string
Inherited
see \toString()
inherited_from \Swift_Mime_SimpleMimeEntity::__toString()

Returns

string

Receive notification that the charset has changed on this document, or a parent document.

charsetChanged(string $charset) 

Parameters

$charset

string

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

encoderChanged(\Swift_Mime_ContentEncoder $encoder) 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::encoderChanged()

Parameters

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

generateId() : string
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::generateId()

Returns

string

Get the body of this entity as a string.

getBody() : string
Inherited

Returns NULL if no body has been set.

inherited_from \Swift_Mime_SimpleMimeEntity::getBody()

Returns

string

Get the boundary used to separate children in this entity.

getBoundary() : string
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::getBoundary()

Returns

string

Get the character set of this entity.

getCharset() : string

Returns

string

Get all children added to this entity.

getChildren() : array
Inherited

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

inherited_from \Swift_Mime_SimpleMimeEntity::getChildren()

Returns

arrayof Swift_Mime_Entity

Get the Content-type of this entity.

getContentType() : string
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::getContentType()

Returns

string

Test if delsp is being used for this entity.

getDelSp() : boolean

Returns

boolean

Get the description of this entity.

getDescription() : string
Inherited

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

inherited_from \Swift_Mime_SimpleMimeEntity::getDescription()

Returns

string

Get the encoder used for the body of this entity.

getEncoder() : \Swift_Mime_ContentEncoder
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::getEncoder()

Returns

Get the format of this entity (i.e.

getFormat() : string

flowed or fixed).

Returns

string

Get the {@link Swift_Mime_HeaderSet} for this entity.

getHeaders() : \Swift_Mime_HeaderSet
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::getHeaders()

Returns

Get the CID of this entity.

getId() : string
Inherited

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

inherited_from \Swift_Mime_SimpleMimeEntity::getId()

Returns

string

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

getMaxLineLength() : int
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::getMaxLineLength()

Returns

int

Get the nesting level of this entity.

getNestingLevel() : int

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

see LEVEL_ALTERNATIVE, LEVEL_MIXED, LEVEL_RELATED

Returns

int

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

setBody(mixed $body, string $contentType, string $charset) : \Swift_Mime_SimpleMimeEntity

Parameters

$body

mixed

$contentType

string

optional

$charset

string

optional

Returns

Set the boundary used to separate children in this entity.

setBoundary(string $boundary) : \Swift_Mime_SimpleMimeEntity
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::setBoundary()

Parameters

$boundary

string

Exceptions

\Swift_RfcComplianceException

Returns

Set the character set of this entity.

setCharset(string $charset) 

Parameters

$charset

string

Set all children of this entity.

setChildren(array $children, int $compoundLevel) : \Swift_Mime_SimpleMimeEntity
Inherited

This includes grandchildren.

inherited_from \Swift_Mime_SimpleMimeEntity::setChildren()

Parameters

$children

array

Swiift_Mime_Entity instances

$compoundLevel

int

For internal use only

Returns

Set the Content-type of this entity.

setContentType(string $type) : \Swift_Mime_SimpleMimeEntity
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::setContentType()

Parameters

$type

string

Returns

Turn delsp on or off for this entity.

setDelSp(boolean $delsp) 

Parameters

$delsp

boolean

Set the description of this entity.

setDescription(string $description) : \Swift_Mime_SimpleMimeEntity
Inherited

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

inherited_from \Swift_Mime_SimpleMimeEntity::setDescription()

Parameters

$description

string

Returns

Set the encoder used for the body of this entity.

setEncoder(\Swift_Mime_ContentEncoder $encoder) : \Swift_Mime_SimpleMimeEntity
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::setEncoder()

Parameters

Returns

Set the format of this entity (flowed or fixed).

setFormat(string $format) 

Parameters

$format

string

Set the CID of this entity.

setId(string $id) : \Swift_Mime_SimpleMimeEntity
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::setId()

Parameters

$id

string

Returns

Set the maximum line length of lines in this body.

setMaxLineLength(int $length) : \Swift_Mime_SimpleMimeEntity
Inherited

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

inherited_from \Swift_Mime_SimpleMimeEntity::setMaxLineLength()

Parameters

$length

int

Returns

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

toByteStream(\Swift_InputByteStream $is) 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::toByteStream()

Parameters

Get this entire entity as a string.

toString() : string
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::toString()

Returns

string

Empty the KeyCache for this entity.

_clearCache() 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::_clearCache()

Encode charset when charset is not utf-8

_convertString($string) 

Parameters

$string

Fix the content-type and encoding of this entity

_fixHeaders() 

Get the KeyCache used in this entity.

_getCache() 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::_getCache()

Get the grammar used for validation.

_getGrammar() : \Swift_Mime_Grammar
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::_getGrammar()

Returns

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

_getHeaderFieldModel($field) 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::_getHeaderFieldModel()

Parameters

$field

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

_getHeaderParameter($field, $parameter) 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::_getHeaderParameter()

Parameters

$field

$parameter

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

_getIdField() 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::_getIdField()

Set the model data for $field.

_setHeaderFieldModel($field, $model) 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::_setHeaderFieldModel()

Parameters

$field

$model

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

_setHeaderParameter($field, $parameter, $value) 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::_setHeaderParameter()

Parameters

$field

$parameter

$value

Set the nesting level of this entity

_setNestingLevel($level) 

Parameters

$level

Returns a random Content-ID or Message-ID.

getRandomId() : string
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::getRandomId()

Returns

string

_assertValidBoundary()

_assertValidBoundary($boundary) 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::_assertValidBoundary()

Parameters

$boundary

Throws an Exception if the id passed does not comply with RFC 2822.

_assertValidId(string $id) 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::_assertValidId()

Parameters

$id

string

Exceptions

\Swift_RfcComplianceException

_childSortAlgorithm()

_childSortAlgorithm($a, $b) 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::_childSortAlgorithm()

Parameters

$a

$b

_createChild()

_createChild() 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::_createChild()

_getCompoundLevel()

_getCompoundLevel($children) 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::_getCompoundLevel()

Parameters

$children

_getNeededChildLevel()

_getNeededChildLevel($child, $compoundLevel) 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::_getNeededChildLevel()

Parameters

$child

$compoundLevel

_notifyCharsetChanged()

_notifyCharsetChanged($charset) 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::_notifyCharsetChanged()

Parameters

$charset

_notifyEncoderChanged()

_notifyEncoderChanged(\Swift_Mime_ContentEncoder $encoder) 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::_notifyEncoderChanged()

Parameters

$encoder

_readStream()

_readStream(\Swift_OutputByteStream $os) 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::_readStream()

Parameters

$os

_setContentTypeInHeaders()

_setContentTypeInHeaders($type) 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::_setContentTypeInHeaders()

Parameters

$type

_setEncoding()

_setEncoding($encoding) 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::_setEncoding()

Parameters

$encoding

_sortChildren()

_sortChildren() 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::_sortChildren()

 Properties

 

$_userCharset 
 

$_userContentType 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::$$_userContentType
 

$_userDelSp 
 

$_userFormat 
 

$_alternativePartOrder 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::$$_alternativePartOrder
 

$_body 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::$$_body
 

$_boundary 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::$$_boundary
 

$_cache 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::$$_cache
 

$_cacheKey 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::$$_cacheKey
 

$_children 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::$$_children
 

$_compositeRanges 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::$$_compositeRanges
 

$_compoundLevelFilters 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::$$_compoundLevelFilters
 

$_encoder 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::$$_encoder
 

$_grammar 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::$$_grammar
 

$_headers 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::$$_headers
 

$_id 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::$$_id
 

$_immediateChildren 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::$$_immediateChildren
 

$_maxLineLength 
Inherited
inherited_from \Swift_Mime_SimpleMimeEntity::$$_maxLineLength
 

$_nestingLevel 

 Constants

 

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

LEVEL_ALTERNATIVE 
Inherited
inherited_from \Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE
inherited_from \Swift_Mime_SimpleMimeEntity::LEVEL_ALTERNATIVE
 

An entity which nests with the same precedence as an attachment

LEVEL_MIXED 
Inherited
inherited_from \Swift_Mime_MimeEntity::LEVEL_MIXED
inherited_from \Swift_Mime_SimpleMimeEntity::LEVEL_MIXED
   

Main message document; there can only be one of these

LEVEL_TOP 
Inherited
inherited_from \Swift_Mime_MimeEntity::LEVEL_TOP
inherited_from \Swift_Mime_SimpleMimeEntity::LEVEL_TOP