__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
Ejemplo n.º 1
0
 /**
  * Create a new Attachment with $headers, $encoder and $cache.
  *
  * @param Swift_Mime_HeaderSet      $headers
  * @param Swift_Mime_ContentEncoder $encoder
  * @param Swift_KeyCache            $cache
  * @param Swift_Mime_Grammar        $grammar
  * @param array                     $mimeTypes optional
  */
 public function __construct(Swift_Mime_HeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache, Swift_Mime_Grammar $grammar, $mimeTypes = array())
 {
     parent::__construct($headers, $encoder, $cache, $grammar);
     $this->setDisposition('attachment');
     $this->setContentType('application/octet-stream');
     $this->_mimeTypes = $mimeTypes;
 }
Ejemplo n.º 2
0
 /**
  * Create a new MimePart with $headers, $encoder and $cache.
  *
  * @param Swift_Mime_HeaderSet      $headers
  * @param Swift_Mime_ContentEncoder $encoder
  * @param Swift_KeyCache            $cache
  * @param Swift_Mime_Grammar        $grammar
  * @param string                    $charset
  */
 public function __construct(Swift_Mime_HeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache, Swift_Mime_Grammar $grammar, $charset = null)
 {
     parent::__construct($headers, $encoder, $cache, $grammar);
     $this->setContentType('text/plain');
     if (!is_null($charset)) {
         $this->setCharset($charset);
     }
 }