From 54722e6816df48dbb98c8b6248d276b1f6039fb8 Mon Sep 17 00:00:00 2001 From: Paul Klimov Date: Fri, 25 Oct 2013 16:58:30 +0300 Subject: [PATCH] Method 'MessageInterface::__toString()' added --- yii/swiftmailer/Message.php | 48 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/yii/swiftmailer/Message.php b/yii/swiftmailer/Message.php index 8ae3ee4..bfefcde 100644 --- a/yii/swiftmailer/Message.php +++ b/yii/swiftmailer/Message.php @@ -49,6 +49,14 @@ class Message extends BaseMessage } /** + * @return string from address of this message. + */ + public function getFrom() + { + return $this->getSwiftMessage()->getFrom(); + } + + /** * @inheritdoc */ public function setTo($to) @@ -57,6 +65,14 @@ class Message extends BaseMessage } /** + * @return array To addresses of this message. + */ + public function getTo() + { + return $this->getSwiftMessage()->getTo(); + } + + /** * @inheritdoc */ public function setCc($cc) @@ -65,6 +81,14 @@ class Message extends BaseMessage } /** + * @return array Cc address of this message. + */ + public function getCc() + { + return $this->getSwiftMessage()->getCc(); + } + + /** * @inheritdoc */ public function setBcc($bcc) @@ -73,6 +97,14 @@ class Message extends BaseMessage } /** + * @return array Bcc addresses of this message. + */ + public function getBcc() + { + return $this->getSwiftMessage()->getBcc(); + } + + /** * @inheritdoc */ public function setSubject($subject) @@ -81,6 +113,14 @@ class Message extends BaseMessage } /** + * @return string the subject of this message. + */ + public function getSubject() + { + return $this->getSwiftMessage()->getSubject(); + } + + /** * @inheritdoc */ public function setText($text) @@ -123,4 +163,12 @@ class Message extends BaseMessage $attachment = \Swift_Attachment::newInstance($content, $fileName, $contentType); $this->getSwiftMessage()->attach($attachment); } + + /** + * @inheritdoc + */ + public function __toString() + { + return $this->getSwiftMessage()->toString(); + } } \ No newline at end of file