Zend Framework  3.0
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Part Class Reference

Class representing a MIME part. More...

Public Member Functions

 __construct ($content= '')
 create a new Mime Part.
 
 setType ($type=Mime::TYPE_OCTETSTREAM)
 Set type.
 
 getType ()
 Get type.
 
 setEncoding ($encoding=Mime::ENCODING_8BIT)
 Set encoding.
 
 getEncoding ()
 Get encoding.
 
 setId ($id)
 Set id.
 
 getId ()
 Get id.
 
 setDisposition ($disposition)
 Set disposition.
 
 getDisposition ()
 Get disposition.
 
 setDescription ($description)
 Set description.
 
 getDescription ()
 Get description.
 
 setFileName ($fileName)
 Set filename.
 
 getFileName ()
 Get filename.
 
 setCharset ($charset)
 Set charset.
 
 getCharset ()
 Get charset.
 
 setBoundary ($boundary)
 Set boundary.
 
 getBoundary ()
 Get boundary.
 
 setLocation ($location)
 Set location.
 
 getLocation ()
 Get location.
 
 setLanguage ($language)
 Set language.
 
 getLanguage ()
 Get language.
 
 setContent ($content)
 Set content.
 
 setIsStream ($isStream=false)
 Set isStream.
 
 getIsStream ()
 Get isStream.
 
 setFilters ($filters=[])
 Set filters.
 
 getFilters ()
 Get Filters.
 
 isStream ()
 check if this part can be read as a stream.
 
 getEncodedStream ($EOL=Mime::LINEEND)
 if this was created with a stream, return a filtered stream for reading the content.
 
 getContent ($EOL=Mime::LINEEND)
 Get the Content of the current Mime Part in the given encoding.
 
 getRawContent ()
 Get the RAW unencoded content from this part.
 
 getHeadersArray ($EOL=Mime::LINEEND)
 Create and return the array of headers for this MIME part.
 
 getHeaders ($EOL=Mime::LINEEND)
 Return the headers for this part as a string.
 

Public Attributes

 $type = Mime::TYPE_OCTETSTREAM
 
 $encoding = Mime::ENCODING_8BIT
 
 $id
 
 $disposition
 
 $filename
 
 $description
 
 $charset
 
 $boundary
 
 $location
 
 $language
 

Protected Attributes

 $content
 
 $isStream = false
 
 $filters = []
 

Detailed Description

Class representing a MIME part.

Constructor & Destructor Documentation

__construct (   $content = '')

create a new Mime Part.

The (unencoded) content of the Part as passed as a string or stream

Parameters
mixed$contentString or Stream containing the content
Exceptions
Exception\InvalidArgumentException

Member Function Documentation

getBoundary ( )

Get boundary.

Returns
string
getCharset ( )

Get charset.

Returns
string
getContent (   $EOL = Mime::LINEEND)

Get the Content of the current Mime Part in the given encoding.

Parameters
string$EOL
Returns
string
getDescription ( )

Get description.

Returns
string
getDisposition ( )

Get disposition.

Returns
string
getEncodedStream (   $EOL = Mime::LINEEND)

if this was created with a stream, return a filtered stream for reading the content.

very useful for large file attachments.

Parameters
string$EOL
Returns
resource
Exceptions
Exception\RuntimeExceptionif not a stream or unable to append filter
getEncoding ( )

Get encoding.

Returns
string
getFileName ( )

Get filename.

Returns
string
getFilters ( )

Get Filters.

Returns
array
getHeaders (   $EOL = Mime::LINEEND)

Return the headers for this part as a string.

Parameters
string$EOL
Returns
String
getHeadersArray (   $EOL = Mime::LINEEND)

Create and return the array of headers for this MIME part.

public

Parameters
string$EOL
Returns
array
getId ( )

Get id.

Returns
string
getIsStream ( )

Get isStream.

Returns
bool
getLanguage ( )

Get language.

Returns
string
getLocation ( )

Get location.

Returns
string
getRawContent ( )

Get the RAW unencoded content from this part.

Returns
string
getType ( )

Get type.

Returns
string
isStream ( )

check if this part can be read as a stream.

if true, getEncodedStream can be called, otherwise only getContent can be used to fetch the encoded content of the part

Returns
bool
setBoundary (   $boundary)

Set boundary.

Parameters
string$boundary
Returns
self
setCharset (   $charset)

Set charset.

Parameters
string$type
Returns
self
setContent (   $content)

Set content.

Parameters
mixed$contentString or Stream containing the content
Exceptions
Exception\InvalidArgumentException
Returns
self
setDescription (   $description)

Set description.

Parameters
string$description
Returns
self
setDisposition (   $disposition)

Set disposition.

Parameters
string$disposition
Returns
self
setEncoding (   $encoding = Mime::ENCODING_8BIT)

Set encoding.

Parameters
string$encoding
Returns
self
setFileName (   $fileName)

Set filename.

Parameters
string$fileName
Returns
self
setFilters (   $filters = [])

Set filters.

Parameters
array$filters
Returns
self
setId (   $id)

Set id.

Parameters
string$id
Returns
self
setIsStream (   $isStream = false)

Set isStream.

Parameters
bool$isStream
Returns
self
setLanguage (   $language)

Set language.

Parameters
string$language
Returns
self
setLocation (   $location)

Set location.

Parameters
string$location
Returns
self
setType (   $type = Mime::TYPE_OCTETSTREAM)

Set type.

Todo:

error checking for setting $type

error checking for setting $encoding

Parameters
string$type
Returns
self

Member Data Documentation

$boundary
$charset
$content
protected
$description
$disposition
$encoding = Mime::ENCODING_8BIT
$filename
$filters = []
protected
$id
$isStream = false
protected
$language
$location