1: <?php
2:
3: /**
4: * Avisota newsletter and mailing system
5: *
6: * PHP Version 5.3
7: *
8: * @copyright bit3 UG 2013
9: * @author Tristan Lins <tristan.lins@bit3.de>
10: * @package avisota-core
11: * @license LGPL-3.0+
12: * @link http://avisota.org
13: */
14:
15: namespace Avisota\Message;
16:
17: /**
18: * A message containing a native swift message.
19: *
20: * @package avisota-core
21: */
22: class NativeMessage implements MessageInterface
23: {
24: /**
25: * The swift message.
26: *
27: * @var \Swift_Message
28: */
29: protected $message;
30:
31: /**
32: * @param \Swift_Message $message
33: */
34: public function __construct(\Swift_Message $message)
35: {
36: $this->message = $message;
37: }
38:
39: /**
40: * {@inheritdoc}
41: */
42: public function getRecipients()
43: {
44: return $this->message->getTo();
45: }
46:
47: /**
48: * {@inheritdoc}
49: */
50: public function getRecipientDetails()
51: {
52: return array();
53: }
54:
55: /**
56: * {@inheritdoc}
57: */
58: public function getCopyRecipients()
59: {
60: return $this->message->getCc();
61: }
62:
63: /**
64: * {@inheritdoc}
65: */
66: public function getBlindCopyRecipients()
67: {
68: return $this->message->getBcc();
69: }
70:
71: /**
72: * {@inheritdoc}
73: */
74: public function getFrom()
75: {
76: return $this->message->getFrom();
77: }
78:
79: /**
80: * {@inheritdoc}
81: */
82: public function getSender()
83: {
84: return $this->message->getSender();
85: }
86:
87: /**
88: * {@inheritdoc}
89: */
90: public function getReplyTo()
91: {
92: return $this->message->getReplyTo();
93: }
94:
95: /**
96: * {@inheritdoc}
97: */
98: public function getSubject()
99: {
100: return $this->message->getSubject();
101: }
102:
103: /**
104: * @return \Swift_Message
105: */
106: public function getMessage()
107: {
108: return $this->message;
109: }
110:
111: /**
112: * {@inheritdoc}
113: */
114: public function serialize()
115: {
116: return serialize($this->message);
117: }
118:
119: /**
120: * {@inheritdoc}
121: */
122: public function unserialize($serialized)
123: {
124: $this->message = unserialize($serialized);
125: }
126: }
127: