Browse Source

'yii\mail\MessageInterface' updated: - setter methods renamed to have pure name - method 'createMessage' renamed to 'compose'

tags/2.0.0-alpha
Klimov Paul 12 years ago
parent
commit
101970641e
  1. 2
      yii/swiftmailer/Mailer.php
  2. 54
      yii/swiftmailer/Message.php

2
yii/swiftmailer/Mailer.php

@ -36,7 +36,7 @@ use Yii;
* *
* @see http://swiftmailer.org * @see http://swiftmailer.org
* *
* @method Message createMessage(array $config = []) creates new message instance from given configuration. * @method Message compose(array $config = []) creates new message instance from given configuration.
* *
* @author Paul Klimov <klimov.paul@gmail.com> * @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0 * @since 2.0

54
yii/swiftmailer/Message.php

@ -59,7 +59,7 @@ class Message extends BaseMessage
/** /**
* @inheritdoc * @inheritdoc
*/ */
public function setFrom($from) public function from($from)
{ {
$this->getSwiftMessage()->setFrom($from); $this->getSwiftMessage()->setFrom($from);
$this->getSwiftMessage()->setReplyTo($from); $this->getSwiftMessage()->setReplyTo($from);
@ -67,85 +67,45 @@ class Message extends BaseMessage
} }
/** /**
* @return string from address of this message.
*/
public function getFrom()
{
return $this->getSwiftMessage()->getFrom();
}
/**
* @inheritdoc * @inheritdoc
*/ */
public function setTo($to) public function to($to)
{ {
$this->getSwiftMessage()->setTo($to); $this->getSwiftMessage()->setTo($to);
return $this; return $this;
} }
/** /**
* @return array To addresses of this message.
*/
public function getTo()
{
return $this->getSwiftMessage()->getTo();
}
/**
* @inheritdoc * @inheritdoc
*/ */
public function setCc($cc) public function cc($cc)
{ {
$this->getSwiftMessage()->setCc($cc); $this->getSwiftMessage()->setCc($cc);
return $this; return $this;
} }
/** /**
* @return array Cc address of this message.
*/
public function getCc()
{
return $this->getSwiftMessage()->getCc();
}
/**
* @inheritdoc * @inheritdoc
*/ */
public function setBcc($bcc) public function bcc($bcc)
{ {
$this->getSwiftMessage()->setBcc($bcc); $this->getSwiftMessage()->setBcc($bcc);
return $this; return $this;
} }
/** /**
* @return array Bcc addresses of this message.
*/
public function getBcc()
{
return $this->getSwiftMessage()->getBcc();
}
/**
* @inheritdoc * @inheritdoc
*/ */
public function setSubject($subject) public function subject($subject)
{ {
$this->getSwiftMessage()->setSubject($subject); $this->getSwiftMessage()->setSubject($subject);
return $this; return $this;
} }
/** /**
* @return string the subject of this message.
*/
public function getSubject()
{
return $this->getSwiftMessage()->getSubject();
}
/**
* @inheritdoc * @inheritdoc
*/ */
public function setText($text) public function text($text)
{ {
$this->setBody($text, 'text/plain'); $this->setBody($text, 'text/plain');
return $this; return $this;
@ -154,7 +114,7 @@ class Message extends BaseMessage
/** /**
* @inheritdoc * @inheritdoc
*/ */
public function setHtml($html) public function html($html)
{ {
$this->setBody($html, 'text/html'); $this->setBody($html, 'text/html');
return $this; return $this;

Loading…
Cancel
Save