Documentation

Swift_MimePart extends Swift_Mime_MimePart
in package

A MIME part, in a multipart message.

Tags
author

Chris Corbyn

Table of Contents

LEVEL_ALTERNATIVE  = 4096
An entity which nests with the same precedence as a mime part
LEVEL_MIXED  = 256
An entity which nests with the same precedence as an attachment
LEVEL_RELATED  = 65536
An entity which nests with the same precedence as embedded content
LEVEL_TOP  = 16
Main message document; there can only be one of these
$userCharset  : mixed
The charset last specified by the user
$userContentType  : mixed
$userDelSp  : mixed
The delsp parameter last specified by the user
$userFormat  : mixed
The format parameter last specified by the user
$alternativePartOrder  : mixed
The order in which alternative mime types should appear
$body  : mixed
The body as a string, or a stream
$boundary  : mixed
A mime boundary, if any is used
$cache  : mixed
A KeyCache instance used during encoding and streaming
$cacheKey  : mixed
The key used for accessing the cache
$children  : mixed
All descendants of this entity
$compositeRanges  : mixed
Mime types to be used based on the nesting level
$compoundLevelFilters  : mixed
A set of filter rules to define what level an entity should be nested at
$encoder  : mixed
The encoder that encodes the body into a streamable format
$headers  : mixed
A collection of Headers for this mime entity
$id  : mixed
The CID of this entity
$idGenerator  : mixed
Message ID generator
$immediateChildren  : mixed
Direct descendants of this entity
$maxLineLength  : mixed
The maximum line length of the body of this entity
$nestingLevel  : mixed
The nesting level of this entity
__clone()  : mixed
Make a deep copy of object.
__construct()  : mixed
Create a new MimePart.
__destruct()  : mixed
Empties it's own contents from the cache.
__toString()  : string
Returns a string representation of this object.
charsetChanged()  : mixed
Receive notification that the charset of this entity, or a parent entity has changed.
encoderChanged()  : mixed
Receive notification that the encoder of this entity or a parent entity has changed.
generateId()  : string
Generate a new Content-ID or Message-ID for this MIME entity.
getBody()  : string
Get the body of this entity as a string.
getBodyContentType()  : string
Get the Body Content-type of this entity.
getBoundary()  : string
Get the boundary used to separate children in this entity.
getCharset()  : string
Get the character set of this entity.
getChildren()  : array<string|int, Swift_Mime_SimpleMimeEntity>
Get all children added to this entity.
getContentType()  : string
Get the Content-type of this entity.
getDelSp()  : bool
Test if delsp is being used for this entity.
getDescription()  : string
Get the description of this entity.
getEncoder()  : Swift_Mime_ContentEncoder
Get the encoder used for the body of this entity.
getFormat()  : string
Get the format of this entity (i.e. flowed or fixed).
getHeaders()  : Swift_Mime_SimpleHeaderSet
Get the {@link Swift_Mime_SimpleHeaderSet} for this entity.
getId()  : string
Get the CID of this entity.
getMaxLineLength()  : int
Get the maximum line length of the body of this entity.
getNestingLevel()  : int
Get the nesting level of this entity.
setBody()  : $this
Set the body of this entity, either as a string, or as an instance of {@link Swift_OutputByteStream}.
setBoundary()  : $this
Set the boundary used to separate children in this entity.
setCharset()  : $this
Set the character set of this entity.
setChildren()  : $this
Set all children of this entity.
setContentType()  : $this
Set the Content-type of this entity.
setDelSp()  : $this
Turn delsp on or off for this entity.
setDescription()  : $this
Set the description of this entity.
setEncoder()  : $this
Set the encoder used for the body of this entity.
setFormat()  : $this
Set the format of this entity (flowed or fixed).
setId()  : $this
Set the CID of this entity.
setMaxLineLength()  : $this
Set the maximum line length of lines in this body.
toByteStream()  : mixed
Write this entire entity to a {@see Swift_InputByteStream}.
toString()  : string
Get this entire entity as a string.
bodyToByteStream()  : mixed
Write this entire entity to a {@link Swift_InputByteStream}.
bodyToString()  : string
Get this entire entity as a string.
clearCache()  : mixed
Empty the KeyCache for this entity.
convertString()  : mixed
Encode charset when charset is not utf-8
fixHeaders()  : mixed
Re-evaluate what content type and encoding should be used on this entity.
getCache()  : Swift_KeyCache
Get the KeyCache used in this entity.
getHeaderFieldModel()  : mixed
Get the model data (usually an array or a string) for $field.
getHeaderParameter()  : mixed
Get the parameter value of $parameter on $field header.
getIdField()  : mixed
Get the name of the header that provides the ID of this entity.
getIdGenerator()  : Swift_IdGenerator
Get the ID generator.
setHeaderFieldModel()  : mixed
Set the model data for $field.
setHeaderParameter()  : mixed
Set the parameter value of $parameter on $field header.
assertValidBoundary()  : mixed
createChild()  : mixed
getCompoundLevel()  : mixed
getNeededChildLevel()  : mixed
notifyCharsetChanged()  : mixed
notifyEncoderChanged()  : mixed
readStream()  : mixed
setContentTypeInHeaders()  : mixed
setEncoding()  : mixed
setNestingLevel()  : mixed
sortChildren()  : mixed

Constants

LEVEL_ALTERNATIVE

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

public mixed LEVEL_ALTERNATIVE = 4096

LEVEL_MIXED

An entity which nests with the same precedence as an attachment

public mixed LEVEL_MIXED = 256

An entity which nests with the same precedence as embedded content

public mixed LEVEL_RELATED = 65536

LEVEL_TOP

Main message document; there can only be one of these

public mixed LEVEL_TOP = 16

Properties

$userCharset

The charset last specified by the user

protected mixed $userCharset

$userDelSp

The delsp parameter last specified by the user

protected mixed $userDelSp

$userFormat

The format parameter last specified by the user

protected mixed $userFormat

$alternativePartOrder

The order in which alternative mime types should appear

private mixed $alternativePartOrder = ['text/plain' => 1, 'text/html' => 2, 'multipart/related' => 3]

$cache

A KeyCache instance used during encoding and streaming

private mixed $cache

$compositeRanges

Mime types to be used based on the nesting level

private mixed $compositeRanges = ['multipart/mixed' => [self::LEVEL_TOP, self::LEVEL_MIXED], 'multipart/alternative' => [self::LEVEL_MIXED, self::LEVEL_ALTERNATIVE], 'multipart/related' => [self::LEVEL_ALTERNATIVE, self::LEVEL_RELATED]]

$compoundLevelFilters

A set of filter rules to define what level an entity should be nested at

private mixed $compoundLevelFilters = []

$encoder

The encoder that encodes the body into a streamable format

private mixed $encoder

$headers

A collection of Headers for this mime entity

private mixed $headers

$immediateChildren

Direct descendants of this entity

private mixed $immediateChildren = []

$maxLineLength

The maximum line length of the body of this entity

private mixed $maxLineLength = 78

$nestingLevel

The nesting level of this entity

private mixed $nestingLevel = self::LEVEL_ALTERNATIVE

Methods

__clone()

Make a deep copy of object.

public __clone() : mixed
Return values
mixed

__construct()

Create a new MimePart.

public __construct([string $body = null ][, string $contentType = null ][, string $charset = null ]) : mixed

Details may be optionally passed into the constructor.

Parameters
$body : string = null
$contentType : string = null
$charset : string = null
Return values
mixed

__destruct()

Empties it's own contents from the cache.

public __destruct() : mixed
Return values
mixed

__toString()

Returns a string representation of this object.

public __toString() : string
Tags
see
toString()
Return values
string

charsetChanged()

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

public charsetChanged(string $charset) : mixed
Parameters
$charset : string
Return values
mixed

generateId()

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

public generateId() : string
Return values
string

getBody()

Get the body of this entity as a string.

public getBody() : string
Return values
string

getBodyContentType()

Get the Body Content-type of this entity.

public getBodyContentType() : string
Return values
string

getBoundary()

Get the boundary used to separate children in this entity.

public getBoundary() : string
Return values
string

getCharset()

Get the character set of this entity.

public getCharset() : string
Return values
string

getContentType()

Get the Content-type of this entity.

public getContentType() : string
Return values
string

getDelSp()

Test if delsp is being used for this entity.

public getDelSp() : bool
Return values
bool

getDescription()

Get the description of this entity.

public getDescription() : string

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

Return values
string

getFormat()

Get the format of this entity (i.e. flowed or fixed).

public getFormat() : string
Return values
string

getId()

Get the CID of this entity.

public getId() : string

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

Return values
string

getMaxLineLength()

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

public getMaxLineLength() : int
Return values
int

getNestingLevel()

Get the nesting level of this entity.

public getNestingLevel() : int
Tags
see

LEVEL_TOP, LEVEL_MIXED, LEVEL_RELATED, LEVEL_ALTERNATIVE

Return values
int

setBody()

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

public setBody(mixed $body[, string $contentType = null ]) : $this
Parameters
$body : mixed
$contentType : string = null

optional

Return values
$this

setBoundary()

Set the boundary used to separate children in this entity.

public setBoundary(string $boundary) : $this
Parameters
$boundary : string
Tags
throws
Swift_RfcComplianceException
Return values
$this

setCharset()

Set the character set of this entity.

public setCharset(string $charset) : $this
Parameters
$charset : string
Return values
$this

setContentType()

Set the Content-type of this entity.

public setContentType(string $type) : $this
Parameters
$type : string
Return values
$this

setDelSp()

Turn delsp on or off for this entity.

public setDelSp([bool $delsp = true ]) : $this
Parameters
$delsp : bool = true
Return values
$this

setDescription()

Set the description of this entity.

public setDescription(string $description) : $this

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

Parameters
$description : string
Return values
$this

setFormat()

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

public setFormat(string $format) : $this
Parameters
$format : string
Return values
$this

setId()

Set the CID of this entity.

public setId(string $id) : $this
Parameters
$id : string
Return values
$this

setMaxLineLength()

Set the maximum line length of lines in this body.

public setMaxLineLength(int $length) : $this

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

Parameters
$length : int
Return values
$this

toString()

Get this entire entity as a string.

public toString() : string
Return values
string

bodyToString()

Get this entire entity as a string.

protected bodyToString() : string
Return values
string

clearCache()

Empty the KeyCache for this entity.

protected clearCache() : mixed
Return values
mixed

convertString()

Encode charset when charset is not utf-8

protected convertString(mixed $string) : mixed
Parameters
$string : mixed
Return values
mixed

fixHeaders()

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

protected fixHeaders() : mixed
Return values
mixed

getHeaderFieldModel()

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

protected getHeaderFieldModel(mixed $field) : mixed
Parameters
$field : mixed
Return values
mixed

getHeaderParameter()

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

protected getHeaderParameter(mixed $field, mixed $parameter) : mixed
Parameters
$field : mixed
$parameter : mixed
Return values
mixed

getIdField()

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

protected getIdField() : mixed
Return values
mixed

setHeaderFieldModel()

Set the model data for $field.

protected setHeaderFieldModel(mixed $field, mixed $model) : mixed
Parameters
$field : mixed
$model : mixed
Return values
mixed

setHeaderParameter()

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

protected setHeaderParameter(mixed $field, mixed $parameter, mixed $value) : mixed
Parameters
$field : mixed
$parameter : mixed
$value : mixed
Return values
mixed

assertValidBoundary()

private assertValidBoundary(mixed $boundary) : mixed
Parameters
$boundary : mixed
Return values
mixed

getCompoundLevel()

private getCompoundLevel(mixed $children) : mixed
Parameters
$children : mixed
Return values
mixed

getNeededChildLevel()

private getNeededChildLevel(mixed $child, mixed $compoundLevel) : mixed
Parameters
$child : mixed
$compoundLevel : mixed
Return values
mixed

notifyCharsetChanged()

private notifyCharsetChanged(mixed $charset) : mixed
Parameters
$charset : mixed
Return values
mixed

setContentTypeInHeaders()

private setContentTypeInHeaders(mixed $type) : mixed
Parameters
$type : mixed
Return values
mixed

setEncoding()

private setEncoding(mixed $encoding) : mixed
Parameters
$encoding : mixed
Return values
mixed

setNestingLevel()

private setNestingLevel(mixed $level) : mixed
Parameters
$level : mixed
Return values
mixed

Search results