Class Swift_Message_Attachment

Description

Attachment component for Swift Mailer

Located in /Swift/Message/Attachment.php (line 18)

Swift_Message_Mime
   |
   --Swift_Message_Attachment
Direct descendents
Class Description
Swift_Message_EmbeddedFile Embedded File component for Swift Mailer
Variable Summary
static int $fileId
Method Summary
static string generateFileName ([string $prefix = "file"])
Swift_Message_Attachment __construct ([mixed $data = null], [string $name = null], [string $type = "application/octet-stream"], [string $encoding = "base64"], [ $disposition = "attachment"])
string getDescription ()
string getDisposition ()
string getFileName ()
string getLevel ()
void preBuild ()
void setData (mixed $data, [boolean $read_filename = true])
void setDescription (string $desc)
void setDisposition (string $disposition)
void setFileName (string $name)
Variables
Methods
static method generateFileName (line 50)

Get a unique filename (just a sequence)

  • access: public
static string generateFileName ([string $prefix = "file"])
  • string $prefix: the prefix for the filename
Constructor __construct (line 33)

Constructor

  • access: public
Swift_Message_Attachment __construct ([mixed $data = null], [string $name = null], [string $type = "application/octet-stream"], [string $encoding = "base64"], [ $disposition = "attachment"])
  • mixed $data: The data to use in the body
  • string $name: Mime type
  • string $type: The encoding format used
  • string $encoding: The charset used
  • $disposition

Redefinition of:
Swift_Message_Mime::__construct()
Constructor

Redefined in descendants as:
getDescription (line 116)

Return the description in the headers

  • access: public
string getDescription ()
getDisposition (line 136)

Get the disposition used in the attachment (usually inline or attachment)

  • access: public
string getDisposition ()
getFileName (line 96)

Get the filename of this attachment

  • access: public
  • throws: Swift_Message_MimeException If some vital headers have been removed
string getFileName ()
getLevel (line 58)

Get the level in the MIME hierarchy at which this section should appear.

  • access: public
string getLevel ()

Redefinition of:
Swift_Message_Mime::getLevel()
Get the level at which this mime part would appear in a document

Redefined in descendants as:
preBuild (line 147)

Execute needed logic prior to building

  • access: public
void preBuild ()

Redefinition of:
Swift_Message_Mime::preBuild()
Execute any logic needed prior to building
setData (line 68)

Overrides setData() in MIME so that a filename can be set

  • access: public
  • throws: Swift_FileException If the stream cannot be read
void setData (mixed $data, [boolean $read_filename = true])
  • mixed $data: The data to set for the body
  • boolean $read_filename: If the stream is a file, should it's filename be used?

Redefinition of:
Swift_Message_Mime::setData()
Specify the string which makes up the body of this message HINT: You can always nest another MIME document here if you call it's build() method.

Redefined in descendants as:
setDescription (line 108)

Set the Content-Description header

  • access: public
void setDescription (string $desc)
  • string $desc: The description in the header (filename usually!)
setDisposition (line 128)

Set the disposition of the attachment (usually inline or attachment)

  • access: public
void setDisposition (string $disposition)
  • string $disposition: The value to use in the Content-Disposition field
setFileName (line 82)

Set the name (and description) used to identify the file

This method overrides any value previously set with setDescription()

  • access: public
  • throws: Swift_Message_MimeException If some required headers have been deliberately removed
void setFileName (string $name)
  • string $name: The filename including it's extension if any

Inherited Methods

Inherited From Swift_Message_Mime

Swift_Message_Mime::__construct()
Swift_Message_Mime::addChild()
Swift_Message_Mime::build()
Swift_Message_Mime::buildData()
Swift_Message_Mime::generateBoundary()
Swift_Message_Mime::getChild()
Swift_Message_Mime::getContentType()
Swift_Message_Mime::getData()
Swift_Message_Mime::getEncoding()
Swift_Message_Mime::getLE()
Swift_Message_Mime::getLevel()
Swift_Message_Mime::hasChild()
Swift_Message_Mime::listChildren()
Swift_Message_Mime::numChildren()
Swift_Message_Mime::preBuild()
Swift_Message_Mime::removeChild()
Swift_Message_Mime::setContentType()
Swift_Message_Mime::setData()
Swift_Message_Mime::setEncoding()
Swift_Message_Mime::setHeaders()
Swift_Message_Mime::setLE()
Swift_Message_Mime::setLineWrap()
Swift_Message_Mime::uncacheAll()
Class Constants

Documentation generated on Wed, 26 Mar 2008 20:33:03 +1100 by phpDocumentor 1.3.1