PHP Class Swift_Mime_SimpleMimeEntity

Author: Chris Corbyn
Inheritance: implements Swift_Mime_MimeEntity
Exibir arquivo Open project: swiftmailer/swiftmailer Class Usage Examples

Protected Properties

Property Type Description
$userContentType

Public Methods

Method Description
__clone ( ) Make a deep copy of object.
__construct ( Swift_Mime_HeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache, Swift_IdGenerator $idGenerator ) Create a new SimpleMimeEntity with $headers, $encoder and $cache.
__destruct ( ) Empties it's own contents from the cache.
__toString ( ) : string Returns a string representation of this object.
charsetChanged ( string $charset ) Receive notification that the charset of this entity, or a parent entity has changed.
encoderChanged ( Swift_Mime_ContentEncoder $encoder ) 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.
getBoundary ( ) : string Get the boundary used to separate children in this entity.
getChildren ( ) : Swift_Mime_MimeEntity[] Get all children added to this entity.
getContentType ( ) : string Get the Content-type of this entity.
getDescription ( ) : string Get the description of this entity.
getEncoder ( ) : Swift_Mime_ContentEncoder Get the encoder used for the body of this entity.
getHeaders ( ) : Swift_Mime_HeaderSet Get the {@link Swift_Mime_HeaderSet} for this entity.
getId ( ) : string Get the CID of this entity.
getMaxLineLength ( ) : integer Get the maximum line length of the body of this entity.
getNestingLevel ( ) : integer Get the nesting level of this entity.
setBody ( mixed $body, string $contentType = null ) Set the body of this entity, either as a string, or as an instance of {@link Swift_OutputByteStream}.
setBoundary ( string $boundary ) Set the boundary used to separate children in this entity.
setChildren ( array $children, integer $compoundLevel = null ) Set all children of this entity.
setContentType ( string $type ) Set the Content-type of this entity.
setDescription ( string $description ) Set the description of this entity.
setEncoder ( Swift_Mime_ContentEncoder $encoder ) Set the encoder used for the body of this entity.
setId ( string $id ) Set the CID of this entity.
setMaxLineLength ( integer $length ) Set the maximum line length of lines in this body.
toByteStream ( Swift_InputByteStream $is ) Write this entire entity to a {@see Swift_InputByteStream}.
toString ( ) : string Get this entire entity as a string.

Protected Methods

Method Description
bodyToByteStream ( Swift_InputByteStream $is ) Write this entire entity to a {@link Swift_InputByteStream}.
bodyToString ( ) : string Get this entire entity as a string.
clearCache ( ) Empty the KeyCache for this entity.
fixHeaders ( ) Re-evaluate what content type and encoding should be used on this entity.
getCache ( ) : Swift_KeyCache Get the KeyCache used in this entity.
getHeaderFieldModel ( $field ) Get the model data (usually an array or a string) for $field.
getHeaderParameter ( $field, $parameter ) Get the parameter value of $parameter on $field header.
getIdField ( ) Get the name of the header that provides the ID of this entity.
getIdGenerator ( ) : Swift_IdGenerator Get the ID generator.
setHeaderFieldModel ( $field, $model ) Set the model data for $field.
setHeaderParameter ( $field, $parameter, $value ) Set the parameter value of $parameter on $field header.

Private Methods

Method Description
assertValidBoundary ( $boundary )
childSortAlgorithm ( $a, $b )
createChild ( )
getCompoundLevel ( $children )
getNeededChildLevel ( $child, $compoundLevel )
notifyCharsetChanged ( $charset )
notifyEncoderChanged ( Swift_Mime_ContentEncoder $encoder )
readStream ( Swift_OutputByteStream $os )
setContentTypeInHeaders ( $type )
setEncoding ( $encoding )
setNestingLevel ( $level )
sortChildren ( )

Method Details

__clone() public method

Make a deep copy of object.
public __clone ( )

__construct() public method

Create a new SimpleMimeEntity with $headers, $encoder and $cache.
public __construct ( Swift_Mime_HeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache, Swift_IdGenerator $idGenerator )
$headers Swift_Mime_HeaderSet
$encoder Swift_Mime_ContentEncoder
$cache Swift_KeyCache
$idGenerator Swift_IdGenerator

__destruct() public method

Empties it's own contents from the cache.
public __destruct ( )

__toString() public method

Returns a string representation of this object.
See also: toString()
public __toString ( ) : string
return string

bodyToByteStream() protected method

Write this entire entity to a {@link Swift_InputByteStream}.
protected bodyToByteStream ( Swift_InputByteStream $is )
$is Swift_InputByteStream

bodyToString() protected method

Get this entire entity as a string.
protected bodyToString ( ) : string
return string

charsetChanged() public method

Receive notification that the charset of this entity, or a parent entity has changed.
public charsetChanged ( string $charset )
$charset string

clearCache() protected method

Empty the KeyCache for this entity.
protected clearCache ( )

encoderChanged() public method

Receive notification that the encoder of this entity or a parent entity has changed.
public encoderChanged ( Swift_Mime_ContentEncoder $encoder )
$encoder Swift_Mime_ContentEncoder

fixHeaders() protected method

Re-evaluate what content type and encoding should be used on this entity.
protected fixHeaders ( )

generateId() public method

Generate a new Content-ID or Message-ID for this MIME entity.
public generateId ( ) : string
return string

getBody() public method

Get the body of this entity as a string.
public getBody ( ) : string
return string

getBoundary() public method

Get the boundary used to separate children in this entity.
public getBoundary ( ) : string
return string

getCache() protected method

Get the KeyCache used in this entity.
protected getCache ( ) : Swift_KeyCache
return Swift_KeyCache

getChildren() public method

Get all children added to this entity.
public getChildren ( ) : Swift_Mime_MimeEntity[]
return Swift_Mime_MimeEntity[]

getContentType() public method

Get the Content-type of this entity.
public getContentType ( ) : string
return string

getDescription() public method

This value comes from the Content-Description header if set.
public getDescription ( ) : string
return string

getEncoder() public method

Get the encoder used for the body of this entity.
public getEncoder ( ) : Swift_Mime_ContentEncoder
return Swift_Mime_ContentEncoder

getHeaderFieldModel() protected method

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

getHeaderParameter() protected method

Get the parameter value of $parameter on $field header.
protected getHeaderParameter ( $field, $parameter )

getHeaders() public method

Get the {@link Swift_Mime_HeaderSet} for this entity.
public getHeaders ( ) : Swift_Mime_HeaderSet
return Swift_Mime_HeaderSet

getId() public method

The CID will only be present in headers if a Content-ID header is present.
public getId ( ) : string
return string

getIdField() protected method

Get the name of the header that provides the ID of this entity.
protected getIdField ( )

getIdGenerator() protected method

Get the ID generator.
protected getIdGenerator ( ) : Swift_IdGenerator
return Swift_IdGenerator

getMaxLineLength() public method

Get the maximum line length of the body of this entity.
public getMaxLineLength ( ) : integer
return integer

getNestingLevel() public method

Get the nesting level of this entity.
public getNestingLevel ( ) : integer
return integer

setBody() public method

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 )
$body mixed
$contentType string optional

setBoundary() public method

Set the boundary used to separate children in this entity.
public setBoundary ( string $boundary )
$boundary string

setChildren() public method

Set all children of this entity.
public setChildren ( array $children, integer $compoundLevel = null )
$children array
$compoundLevel integer For internal use only

setContentType() public method

Set the Content-type of this entity.
public setContentType ( string $type )
$type string

setDescription() public method

This method sets a value in the Content-ID header.
public setDescription ( string $description )
$description string

setEncoder() public method

Set the encoder used for the body of this entity.
public setEncoder ( Swift_Mime_ContentEncoder $encoder )
$encoder Swift_Mime_ContentEncoder

setHeaderFieldModel() protected method

Set the model data for $field.
protected setHeaderFieldModel ( $field, $model )

setHeaderParameter() protected method

Set the parameter value of $parameter on $field header.
protected setHeaderParameter ( $field, $parameter, $value )

setId() public method

Set the CID of this entity.
public setId ( string $id )
$id string

setMaxLineLength() public method

Though not enforced by the library, lines should not exceed 1000 chars.
public setMaxLineLength ( integer $length )
$length integer

toByteStream() public method

Write this entire entity to a {@see Swift_InputByteStream}.
public toByteStream ( Swift_InputByteStream $is )
$is Swift_InputByteStream

toString() public method

Get this entire entity as a string.
public toString ( ) : string
return string

Property Details

$userContentType protected_oe property

protected $userContentType