TYPO3  7.6
EmbeddedFile.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of SwiftMailer.
5  * (c) 2004-2009 Chris Corbyn
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10 
17 {
27  public function __construct($data = null, $filename = null, $contentType = null)
28  {
29  call_user_func_array(
30  array($this, 'Swift_Mime_EmbeddedFile::__construct'),
32  ->createDependenciesFor('mime.embeddedfile')
33  );
34 
35  $this->setBody($data);
36  $this->setFilename($filename);
37  if ($contentType) {
38  $this->setContentType($contentType);
39  }
40  }
41 
51  public static function newInstance($data = null, $filename = null, $contentType = null)
52  {
53  return new self($data, $filename, $contentType);
54  }
55 
63  public static function fromPath($path)
64  {
65  return self::newInstance()->setFile(
67  );
68  }
69 }