XOOPS RMCommon Utilities  2.1.8.91RC
 All Classes Namespaces Files Functions Variables
Swift_Mime_SimpleMimeEntity Class Reference
Inheritance diagram for Swift_Mime_SimpleMimeEntity:
Inheritance graph

Public Member Functions

 __construct (Swift_Mime_HeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache)
 
 __destruct ()
 
 __toString ()
 
 charsetChanged ($charset)
 
 encoderChanged (Swift_Mime_ContentEncoder $encoder)
 
 generateId ()
 
 getBody ()
 
 getBoundary ()
 
 getChildren ()
 
 getContentType ()
 
 getDescription ()
 
 getEncoder ()
 
 getHeaders ()
 
 getId ()
 
 getMaxLineLength ()
 
 getNestingLevel ()
 
 setBody ($body, $contentType=null)
 
 setBoundary ($boundary)
 
 setChildren (array $children, $compoundLevel=null)
 
 setContentType ($type)
 
 setDescription ($description)
 
 setEncoder (Swift_Mime_ContentEncoder $encoder)
 
 setId ($id)
 
 setMaxLineLength ($length)
 
 toByteStream (Swift_InputByteStream $is)
 
 toString ()
 
- Public Member Functions inherited from Swift_Mime_MimeEntity
 setChildren (array $children)
 

Protected Member Functions

 _clearCache ()
 
 _fixHeaders ()
 
 _getCache ()
 
 _getHeaderFieldModel ($field)
 
 _getHeaderParameter ($field, $parameter)
 
 _getIdField ()
 
 _setHeaderFieldModel ($field, $model)
 
 _setHeaderParameter ($field, $parameter, $value)
 
 getRandomId ()
 

Protected Attributes

 $_userContentType
 

Private Member Functions

 _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 ()
 

Private Attributes

 $_alternativePartOrder
 
 $_body
 
 $_boundary
 
 $_cache
 
 $_cacheKey
 
 $_children = array()
 
 $_compositeRanges
 
 $_compoundLevelFilters = array()
 
 $_encoder
 
 $_headers
 
 $_id
 
 $_immediateChildren = array()
 
 $_maxLineLength = 78
 
 $_nestingLevel = self::LEVEL_ALTERNATIVE
 

Additional Inherited Members

- Public Attributes inherited from Swift_Mime_MimeEntity
const LEVEL_ALTERNATIVE = 4096
 
const LEVEL_MIXED = 256
 
const LEVEL_RELATED = 65536
 
const LEVEL_TOP = 16
 

Detailed Description

Definition at line 22 of file SimpleMimeEntity.php.

Constructor & Destructor Documentation

Swift_Mime_SimpleMimeEntity::__construct ( Swift_Mime_HeaderSet  $headers,
Swift_Mime_ContentEncoder  $encoder,
Swift_KeyCache  $cache 
)

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

Parameters
Swift_Mime_HeaderSet$headers
Swift_Mime_ContentEncoder$encoder
Swift_KeyCache$cache

Definition at line 83 of file SimpleMimeEntity.php.

References getRandomId(), and setEncoder().

Here is the call graph for this function:

Swift_Mime_SimpleMimeEntity::__destruct ( )

Empties it's own contents from the cache.

Definition at line 798 of file SimpleMimeEntity.php.

Member Function Documentation

Swift_Mime_SimpleMimeEntity::__toString ( )

Returns a string representation of this object.

Returns
string
See Also
toString()

Definition at line 478 of file SimpleMimeEntity.php.

References toString().

Here is the call graph for this function:

Swift_Mime_SimpleMimeEntity::_assertValidBoundary (   $boundary)
private

Definition at line 675 of file SimpleMimeEntity.php.

Referenced by setBoundary().

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::_childSortAlgorithm (   $a,
  $b 
)
private

Definition at line 777 of file SimpleMimeEntity.php.

References $type.

Swift_Mime_SimpleMimeEntity::_clearCache ( )
protected

Empty the KeyCache for this entity.

Definition at line 637 of file SimpleMimeEntity.php.

Referenced by setBody(), Swift_Mime_MimePart\setCharset(), and setEncoder().

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::_createChild ( )
private

Definition at line 733 of file SimpleMimeEntity.php.

References $_cache, and $_encoder.

Referenced by setChildren().

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::_fixHeaders ( )
protected

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

Definition at line 610 of file SimpleMimeEntity.php.

References _setEncoding(), _setHeaderParameter(), and getBoundary().

Referenced by setChildren().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::_getCache ( )
protected

Get the KeyCache used in this entity.

Definition at line 629 of file SimpleMimeEntity.php.

References $_cache.

Referenced by Swift_Mime_SimpleMessage\_becomeMimePart().

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::_getCompoundLevel (   $children)
private

Definition at line 698 of file SimpleMimeEntity.php.

Referenced by setChildren().

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::_getHeaderParameter (   $field,
  $parameter 
)
protected

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

Definition at line 583 of file SimpleMimeEntity.php.

References $field.

Referenced by Swift_Mime_MimePart\getCharset(), Swift_Mime_MimePart\getDelSp(), Swift_Mime_Attachment\getFilename(), Swift_Mime_MimePart\getFormat(), and Swift_Mime_Attachment\getSize().

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::_getIdField ( )
protected

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

Definition at line 548 of file SimpleMimeEntity.php.

Referenced by getId(), and setId().

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::_getNeededChildLevel (   $child,
  $compoundLevel 
)
private

Definition at line 708 of file SimpleMimeEntity.php.

Referenced by setChildren().

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::_notifyCharsetChanged (   $charset)
private

Definition at line 747 of file SimpleMimeEntity.php.

Referenced by charsetChanged().

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::_notifyEncoderChanged ( Swift_Mime_ContentEncoder  $encoder)
private

Definition at line 739 of file SimpleMimeEntity.php.

Referenced by encoderChanged(), and setEncoder().

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::_readStream ( Swift_OutputByteStream  $os)
private

Definition at line 657 of file SimpleMimeEntity.php.

References Swift_OutputByteStream\read().

Referenced by getBody().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::_setContentTypeInHeaders (   $type)
private

Definition at line 685 of file SimpleMimeEntity.php.

References $type, and _setHeaderFieldModel().

Referenced by setChildren(), and setContentType().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::_setEncoding (   $encoding)
private

Definition at line 667 of file SimpleMimeEntity.php.

References _setHeaderFieldModel().

Referenced by _fixHeaders(), and setEncoder().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::_setHeaderParameter (   $field,
  $parameter,
  $value 
)
protected

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

Definition at line 594 of file SimpleMimeEntity.php.

References $field.

Referenced by Swift_Mime_MimePart\_fixHeaders(), _fixHeaders(), Swift_Mime_MimePart\setCharset(), Swift_Mime_MimePart\setDelSp(), Swift_Mime_Attachment\setFilename(), Swift_Mime_MimePart\setFormat(), and Swift_Mime_Attachment\setSize().

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::_setNestingLevel (   $level)
private

Definition at line 693 of file SimpleMimeEntity.php.

Swift_Mime_SimpleMimeEntity::_sortChildren ( )
private

Definition at line 757 of file SimpleMimeEntity.php.

Referenced by setChildren().

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::charsetChanged (   $charset)

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

Parameters
string$charset

Implements Swift_Mime_CharsetObserver.

Definition at line 418 of file SimpleMimeEntity.php.

References _notifyCharsetChanged().

Here is the call graph for this function:

Swift_Mime_SimpleMimeEntity::encoderChanged ( Swift_Mime_ContentEncoder  $encoder)

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

Parameters
Swift_Mime_ContentEncoder$encoder

Implements Swift_Mime_EncodingObserver.

Definition at line 428 of file SimpleMimeEntity.php.

References _notifyEncoderChanged().

Here is the call graph for this function:

Swift_Mime_SimpleMimeEntity::generateId ( )

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

Returns
string

Definition at line 123 of file SimpleMimeEntity.php.

References $_id, getRandomId(), and setId().

Here is the call graph for this function:

Swift_Mime_SimpleMimeEntity::getBody ( )

Get the body of this entity as a string.

Returns
string

Implements Swift_Mime_MimeEntity.

Definition at line 334 of file SimpleMimeEntity.php.

References $_body, and _readStream().

Referenced by toString().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::getBoundary ( )

Get the boundary used to separate children in this entity.

Returns
string

Definition at line 392 of file SimpleMimeEntity.php.

References $_boundary.

Referenced by _fixHeaders(), toByteStream(), and toString().

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::getChildren ( )

Get all children added to this entity.

Returns
array of Swift_Mime_Entity

Implements Swift_Mime_MimeEntity.

Definition at line 244 of file SimpleMimeEntity.php.

References $_children.

Referenced by Swift_Mime_MimePart\_fixHeaders().

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::getContentType ( )

Get the Content-type of this entity.

Returns
string

Implements Swift_Mime_MimeEntity.

Definition at line 152 of file SimpleMimeEntity.php.

References _getHeaderFieldModel().

Here is the call graph for this function:

Swift_Mime_SimpleMimeEntity::getDescription ( )

Get the description of this entity. This value comes from the Content-Description header if set.

Returns
string

Definition at line 201 of file SimpleMimeEntity.php.

References _getHeaderFieldModel().

Here is the call graph for this function:

Swift_Mime_SimpleMimeEntity::getEncoder ( )

Get the encoder used for the body of this entity.

Returns
Swift_Mime_ContentEncoder

Definition at line 366 of file SimpleMimeEntity.php.

References $_encoder.

Referenced by Swift_Mime_SimpleMessage\_becomeMimePart().

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::getHeaders ( )

Get the Swift_Mime_HeaderSet for this entity.

Returns
Swift_Mime_HeaderSet

Implements Swift_Mime_MimeEntity.

Definition at line 133 of file SimpleMimeEntity.php.

References $_headers.

Referenced by Swift_Mime_Attachment\setDisposition().

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::getId ( )

Get the CID of this entity. The CID will only be present in headers if a Content-ID header is present.

Returns
string

Implements Swift_Mime_MimeEntity.

Definition at line 175 of file SimpleMimeEntity.php.

References $_id, _getHeaderFieldModel(), and _getIdField().

Referenced by Swift_Mime_EmbeddedFile\__construct().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::getMaxLineLength ( )

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

Returns
int

Definition at line 224 of file SimpleMimeEntity.php.

References $_maxLineLength.

Referenced by toByteStream(), and toString().

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::getNestingLevel ( )

Get the nesting level of this entity.

Returns
int
See Also
LEVEL_TOP, LEVEL_MIXED, LEVEL_RELATED, LEVEL_ALTERNATIVE

Implements Swift_Mime_MimeEntity.

Definition at line 143 of file SimpleMimeEntity.php.

References $_nestingLevel.

Swift_Mime_SimpleMimeEntity::getRandomId ( )
protected

Returns a random Content-ID or Message-ID.

Returns
string

Definition at line 646 of file SimpleMimeEntity.php.

Referenced by __construct(), and generateId().

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::setBody (   $body,
  $contentType = null 
)

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

Parameters
mixed$body
string$contentTypeoptional

Implements Swift_Mime_MimeEntity.

Definition at line 347 of file SimpleMimeEntity.php.

References _clearCache(), and setContentType().

Referenced by Swift_Attachment\__construct(), Swift_EmbeddedFile\__construct(), and Swift_Mime_Attachment\setFile().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::setBoundary (   $boundary)

Set the boundary used to separate children in this entity.

Parameters
string$boundary
Exceptions
Swift_RfcComplianceException

Definition at line 406 of file SimpleMimeEntity.php.

References _assertValidBoundary().

Here is the call graph for this function:

Swift_Mime_SimpleMimeEntity::setChildren ( array  $children,
  $compoundLevel = null 
)

Set all children of this entity.

Parameters
array$childrenSwiift_Mime_Entity instances
int$compoundLevelFor internal use only

Definition at line 254 of file SimpleMimeEntity.php.

References $_userContentType, _createChild(), _fixHeaders(), _getCompoundLevel(), _getNeededChildLevel(), _setContentTypeInHeaders(), _sortChildren(), and elseif().

Here is the call graph for this function:

Swift_Mime_SimpleMimeEntity::setContentType (   $type)

Set the Content-type of this entity.

Parameters
string$type

Definition at line 161 of file SimpleMimeEntity.php.

References $type, and _setContentTypeInHeaders().

Referenced by Swift_MimePart\__construct(), Swift_EmbeddedFile\__construct(), Swift_Attachment\__construct(), Swift_Message\__construct(), Swift_Mime_Attachment\__construct(), Swift_Mime_MimePart\__construct(), setBody(), and Swift_Mime_Attachment\setFile().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::setDescription (   $description)

Set the description of this entity. This method sets a value in the Content-ID header.

Parameters
string$description

Definition at line 211 of file SimpleMimeEntity.php.

References _setHeaderFieldModel().

Here is the call graph for this function:

Swift_Mime_SimpleMimeEntity::setEncoder ( Swift_Mime_ContentEncoder  $encoder)

Set the encoder used for the body of this entity.

Parameters
Swift_Mime_ContentEncoder$encoder

Definition at line 375 of file SimpleMimeEntity.php.

References _clearCache(), _notifyEncoderChanged(), _setEncoding(), and Swift_Mime_ContentEncoder\getName().

Referenced by __construct().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::setId (   $id)

Set the CID of this entity.

Parameters
string$id

Definition at line 186 of file SimpleMimeEntity.php.

References $id, _getIdField(), and _setHeaderFieldModel().

Referenced by Swift_Mime_EmbeddedFile\__construct(), Swift_Mime_SimpleMessage\__construct(), and generateId().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Mime_SimpleMimeEntity::setMaxLineLength (   $length)

Set the maximum line length of lines in this body. Though not enforced by the library, lines should not exceed 1000 chars.

Parameters
int$length

Definition at line 234 of file SimpleMimeEntity.php.

Swift_Mime_SimpleMimeEntity::toByteStream ( Swift_InputByteStream  $is)

Write this entire entity to a Swift_InputByteStream.

Parameters
Swift_InputByteStream

Implements Swift_Mime_MimeEntity.

Definition at line 487 of file SimpleMimeEntity.php.

References Swift_InputByteStream\bind(), Swift_InputByteStream\commit(), getBoundary(), getMaxLineLength(), Swift_InputByteStream\unbind(), and Swift_InputByteStream\write().

Here is the call graph for this function:

Swift_Mime_SimpleMimeEntity::toString ( )

Get this entire entity as a string.

Returns
string

Implements Swift_Mime_MimeEntity.

Definition at line 437 of file SimpleMimeEntity.php.

References getBody(), getBoundary(), getMaxLineLength(), and Swift_KeyCache\MODE_WRITE.

Referenced by __toString().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Swift_Mime_SimpleMimeEntity::$_alternativePartOrder
private
Initial value:
= array(
'text/plain' => 1,
'text/html' => 2,
'multipart/related' => 3
)

The order in which alternative mime types should appear

Definition at line 63 of file SimpleMimeEntity.php.

Swift_Mime_SimpleMimeEntity::$_body
private

The body as a string, or a stream

Definition at line 29 of file SimpleMimeEntity.php.

Referenced by getBody().

Swift_Mime_SimpleMimeEntity::$_boundary
private

A mime bounary, if any is used

Definition at line 35 of file SimpleMimeEntity.php.

Referenced by getBoundary().

Swift_Mime_SimpleMimeEntity::$_cache
private

A KeyCache instance used during encoding and streaming

Definition at line 51 of file SimpleMimeEntity.php.

Referenced by _createChild(), and _getCache().

Swift_Mime_SimpleMimeEntity::$_cacheKey
private

The key used for accessing the cache

Definition at line 73 of file SimpleMimeEntity.php.

Swift_Mime_SimpleMimeEntity::$_children = array()
private

All descendants of this entity

Definition at line 57 of file SimpleMimeEntity.php.

Referenced by getChildren().

Swift_Mime_SimpleMimeEntity::$_compositeRanges
private
Initial value:
= array(
'multipart/mixed' => array(self::LEVEL_TOP, self::LEVEL_MIXED),
'multipart/alternative' => array(self::LEVEL_MIXED, self::LEVEL_ALTERNATIVE),
'multipart/related' => array(self::LEVEL_ALTERNATIVE, self::LEVEL_RELATED)
)

Mime types to be used based on the nesting level

Definition at line 38 of file SimpleMimeEntity.php.

Swift_Mime_SimpleMimeEntity::$_compoundLevelFilters = array()
private

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

Definition at line 45 of file SimpleMimeEntity.php.

Swift_Mime_SimpleMimeEntity::$_encoder
private

The encoder that encodes the body into a streamable format

Definition at line 32 of file SimpleMimeEntity.php.

Referenced by _createChild(), and getEncoder().

Swift_Mime_SimpleMimeEntity::$_headers
private

A collection of Headers for this mime entity

Definition at line 26 of file SimpleMimeEntity.php.

Referenced by getHeaders().

Swift_Mime_SimpleMimeEntity::$_id
private

The CID of this entity

Definition at line 70 of file SimpleMimeEntity.php.

Referenced by generateId(), and getId().

Swift_Mime_SimpleMimeEntity::$_immediateChildren = array()
private

Direct descendants of this entity

Definition at line 54 of file SimpleMimeEntity.php.

Swift_Mime_SimpleMimeEntity::$_maxLineLength = 78
private

The maximum line length of the body of this entity

Definition at line 60 of file SimpleMimeEntity.php.

Referenced by getMaxLineLength().

Swift_Mime_SimpleMimeEntity::$_nestingLevel = self::LEVEL_ALTERNATIVE
private

The nesting level of this entity

Definition at line 48 of file SimpleMimeEntity.php.

Referenced by getNestingLevel().

Swift_Mime_SimpleMimeEntity::$_userContentType
protected

Definition at line 75 of file SimpleMimeEntity.php.

Referenced by setChildren().


The documentation for this class was generated from the following file: