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:
11: /**
12: * A MIME part, in a multipart message.
13: * @package Swift
14: * @subpackage Mime
15: * @author Chris Corbyn
16: */
17: class Swift_MimePart extends Swift_Mime_MimePart
18: {
19: /**
20: * Create a new MimePart.
21: * Details may be optionally passed into the constructor.
22: * @param string $body
23: * @param string $contentType
24: * @param string $charset
25: */
26: public function __construct($body = null, $contentType = null, $charset = null)
27: {
28: call_user_func_array(
29: array($this, 'Swift_Mime_MimePart::__construct'),
30: Swift_DependencyContainer::getInstance()
31: ->createDependenciesFor('mime.part')
32: );
33:
34: if (!isset($charset)) {
35: $charset = Swift_DependencyContainer::getInstance()
36: ->lookup('properties.charset');
37: }
38: $this->setBody($body);
39: $this->setCharset($charset);
40: if ($contentType) {
41: $this->setContentType($contentType);
42: }
43: }
44:
45: /**
46: * Create a new MimePart.
47: * @param string $body
48: * @param string $contentType
49: * @param string $charset
50: * @return Swift_Mime_MimePart
51: */
52: public static function newInstance($body = null, $contentType = null, $charset = null)
53: {
54: return new self($body, $contentType, $charset);
55: }
56: }
57: