Avail feature updated
[ninja.git] / application / vendor / swiftmailer / classes / Swift / MimePart.php
blob60b6d56999b2134a17bc2e7c9f0b06b2a4242226
1 <?php
3 /*
4 * This file is part of SwiftMailer.
5 * (c) 2004-2009 Chris Corbyn
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
11 //@require 'Swift/Mime/MimePart.php';
12 //@require 'Swift/DependencyContainer.php';
14 /**
15 * A MIME part, in a multipart message.
16 * @package Swift
17 * @subpackage Mime
18 * @author Chris Corbyn
20 class Swift_MimePart extends Swift_Mime_MimePart
23 /**
24 * Create a new MimePart.
25 * Details may be optionally passed into the constructor.
26 * @param string $body
27 * @param string $contentType
28 * @param string $charset
30 public function __construct($body = null, $contentType = null,
31 $charset = null)
33 call_user_func_array(
34 array($this, 'Swift_Mime_MimePart::__construct'),
35 Swift_DependencyContainer::getInstance()
36 ->createDependenciesFor('mime.part')
39 if (!isset($charset))
41 $charset = Swift_DependencyContainer::getInstance()
42 ->lookup('properties.charset');
44 $this->setBody($body);
45 $this->setCharset($charset);
46 if ($contentType)
48 $this->setContentType($contentType);
52 /**
53 * Create a new MimePart.
54 * @param string $body
55 * @param string $contentType
56 * @param string $charset
57 * @return Swift_Mime_MimePart
59 public static function newInstance($body = null, $contentType = null,
60 $charset = null)
62 return new self($body, $contentType, $charset);