Swift_Image
extends Swift_EmbeddedFile
in package
An image, embedded in a multipart message.
Tags
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
- $userContentType : mixed
- $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
- $mimeTypes : mixed
- Recognized MIME types
- $nestingLevel : mixed
- The nesting level of this entity
- __clone() : mixed
- Make a deep copy of object.
- __construct() : mixed
- Create a new EmbeddedFile.
- __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.
- fromPath() : self
- Create a new Image from a filesystem path.
- 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.
- getChildren() : array<string|int, Swift_Mime_SimpleMimeEntity>
- Get all children added to this entity.
- getContentType() : string
- Get the Content-type of this entity.
- getDescription() : string
- Get the description of this entity.
- getDisposition() : string
- Get the Content-Disposition of this attachment.
- getEncoder() : Swift_Mime_ContentEncoder
- Get the encoder used for the body of this entity.
- getFilename() : string
- Get the filename of this attachment when downloaded.
- 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.
- getSize() : int
- Get the file size of this attachment.
- 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.
- setChildren() : $this
- Set all children of this entity.
- setContentType() : $this
- Set the Content-type of this entity.
- setDescription() : $this
- Set the description of this entity.
- setDisposition() : $this
- Set the Content-Disposition of this attachment.
- setEncoder() : $this
- Set the encoder used for the body of this entity.
- setFile() : $this
- Set the file that this attachment is for.
- setFilename() : $this
- Set the filename of this attachment.
- setId() : $this
- Set the CID of this entity.
- setMaxLineLength() : $this
- Set the maximum line length of lines in this body.
- setSize() : $this
- Set the file size of this attachment.
- 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.
- 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
LEVEL_RELATED
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
$userContentType
protected
mixed
$userContentType
$alternativePartOrder
The order in which alternative mime types should appear
private
mixed
$alternativePartOrder
= ['text/plain' => 1, 'text/html' => 2, 'multipart/related' => 3]
$body
The body as a string, or a stream
private
mixed
$body
$boundary
A mime boundary, if any is used
private
mixed
$boundary
$cache
A KeyCache instance used during encoding and streaming
private
mixed
$cache
$cacheKey
The key used for accessing the cache
private
mixed
$cacheKey
$children
All descendants of this entity
private
mixed
$children
= []
$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
$id
The CID of this entity
private
mixed
$id
$idGenerator
Message ID generator
private
mixed
$idGenerator
$immediateChildren
Direct descendants of this entity
private
mixed
$immediateChildren
= []
$maxLineLength
The maximum line length of the body of this entity
private
mixed
$maxLineLength
= 78
$mimeTypes
Recognized MIME types
private
mixed
$mimeTypes
= []
$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 EmbeddedFile.
public
__construct([string|Swift_OutputByteStream $data = null ][, string $filename = null ][, string $contentType = null ]) : mixed
Details may be optionally provided to the constructor.
Parameters
- $data : string|Swift_OutputByteStream = null
- $filename : string = null
- $contentType : 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
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 —encoderChanged()
Receive notification that the encoder of this entity or a parent entity has changed.
public
encoderChanged(Swift_Mime_ContentEncoder $encoder) : mixed
Parameters
- $encoder : Swift_Mime_ContentEncoder
Return values
mixed —fromPath()
Create a new Image from a filesystem path.
public
static fromPath(string $path) : self
Parameters
- $path : string
Return values
self —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 —getChildren()
Get all children added to this entity.
public
getChildren() : array<string|int, Swift_Mime_SimpleMimeEntity>
Return values
array<string|int, Swift_Mime_SimpleMimeEntity> —getContentType()
Get the Content-type of this entity.
public
getContentType() : string
Return values
string —getDescription()
Get the description of this entity.
public
getDescription() : string
This value comes from the Content-Description header if set.
Return values
string —getDisposition()
Get the Content-Disposition of this attachment.
public
getDisposition() : string
By default attachments have a disposition of "attachment".
Return values
string —getEncoder()
Get the encoder used for the body of this entity.
public
getEncoder() : Swift_Mime_ContentEncoder
Return values
Swift_Mime_ContentEncoder —getFilename()
Get the filename of this attachment when downloaded.
public
getFilename() : string
Return values
string —getHeaders()
Get the {@link Swift_Mime_SimpleHeaderSet} for this entity.
public
getHeaders() : Swift_Mime_SimpleHeaderSet
Return values
Swift_Mime_SimpleHeaderSet —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
Return values
int —getSize()
Get the file size of this attachment.
public
getSize() : int
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
Return values
$this —setChildren()
Set all children of this entity.
public
setChildren(array<string|int, Swift_Mime_SimpleMimeEntity> $children[, int $compoundLevel = null ]) : $this
Parameters
- $children : array<string|int, Swift_Mime_SimpleMimeEntity>
- $compoundLevel : int = null
-
For internal use only
Return values
$this —setContentType()
Set the Content-type of this entity.
public
setContentType(string $type) : $this
Parameters
- $type : string
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 —setDisposition()
Set the Content-Disposition of this attachment.
public
setDisposition(string $disposition) : $this
Parameters
- $disposition : string
Return values
$this —setEncoder()
Set the encoder used for the body of this entity.
public
setEncoder(Swift_Mime_ContentEncoder $encoder) : $this
Parameters
- $encoder : Swift_Mime_ContentEncoder
Return values
$this —setFile()
Set the file that this attachment is for.
public
setFile(Swift_FileStream $file[, string $contentType = null ]) : $this
Parameters
- $file : Swift_FileStream
- $contentType : string = null
-
optional
Return values
$this —setFilename()
Set the filename of this attachment.
public
setFilename(string $filename) : $this
Parameters
- $filename : 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 —setSize()
Set the file size of this attachment.
public
setSize(int $size) : $this
Parameters
- $size : int
Return values
$this —toByteStream()
Write this entire entity to a {@see Swift_InputByteStream}.
public
toByteStream(Swift_InputByteStream $is) : mixed
Parameters
- $is : Swift_InputByteStream
Return values
mixed —toString()
Get this entire entity as a string.
public
toString() : string
Return values
string —bodyToByteStream()
Write this entire entity to a {@link Swift_InputByteStream}.
protected
bodyToByteStream(Swift_InputByteStream $is) : mixed
Parameters
- $is : Swift_InputByteStream
Return values
mixed —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 —fixHeaders()
Re-evaluate what content type and encoding should be used on this entity.
protected
fixHeaders() : mixed
Return values
mixed —getCache()
Get the KeyCache used in this entity.
protected
getCache() : Swift_KeyCache
Return values
Swift_KeyCache —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 —getIdGenerator()
Get the ID generator.
protected
getIdGenerator() : Swift_IdGenerator
Return values
Swift_IdGenerator —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 —createChild()
private
createChild() : 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 —notifyEncoderChanged()
private
notifyEncoderChanged(Swift_Mime_ContentEncoder $encoder) : mixed
Parameters
- $encoder : Swift_Mime_ContentEncoder
Return values
mixed —readStream()
private
readStream(Swift_OutputByteStream $os) : mixed
Parameters
- $os : Swift_OutputByteStream
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 —sortChildren()
private
sortChildren() : mixed