Completed
Push — master ( 73aef9...c8323f )
by Georg
60:20 queued 46:52
created

Attachment::setBody()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * @copyright Copyright (c) 2017 Joas Schilling <[email protected]>
4
 *
5
 * @license GNU AGPL version 3 or any later version
6
 *
7
 * This program is free software: you can redistribute it and/or modify
8
 * it under the terms of the GNU Affero General Public License as
9
 * published by the Free Software Foundation, either version 3 of the
10
 * License, or (at your option) any later version.
11
 *
12
 * This program is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU Affero General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU Affero General Public License
18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
 *
20
 */
21
22
namespace OC\Mail;
23
24
use OCP\Mail\IAttachment;
25
26
/**
27
 * Class Attachment
28
 *
29
 * @package OC\Mail
30
 * @since 13.0.0
31
 */
32
class Attachment implements IAttachment {
33
34
	/** @var \Swift_Mime_Attachment */
35
	protected $swiftAttachment;
36
37
	public function __construct(\Swift_Mime_Attachment $attachment) {
38
		$this->swiftAttachment = $attachment;
39
	}
40
41
	/**
42
	 * @param string $filename
43
	 * @return $this
44
	 * @since 13.0.0
45
	 */
46
	public function setFilename($filename) {
47
		$this->swiftAttachment->setFilename($filename);
48
		return $this;
49
	}
50
51
	/**
52
	 * @param string $contentType
53
	 * @return $this
54
	 * @since 13.0.0
55
	 */
56
	public function setContentType($contentType) {
57
		$this->swiftAttachment->setContentType($contentType);
58
		return $this;
59
	}
60
61
	/**
62
	 * @param string $body
63
	 * @return $this
64
	 * @since 13.0.0
65
	 */
66
	public function setBody($body) {
67
		$this->swiftAttachment->setBody($body);
68
		return $this;
69
	}
70
71
	/**
72
	 * @return \Swift_Mime_Attachment
73
	 */
74
	public function getSwiftAttachment() {
75
		return $this->swiftAttachment;
76
	}
77
78
}
79