Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
d33519e3
Commit
d33519e3
authored
Oct 25, 2013
by
Paul Klimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Method 'MessageInterface::__toString()' added
parent
4a9d546c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
0 deletions
+63
-0
Message.php
extensions/swiftmailer/yii/swiftmailer/Message.php
+49
-0
MessageInterface.php
framework/yii/mail/MessageInterface.php
+8
-0
BaseMailerTest.php
tests/unit/framework/mail/BaseMailerTest.php
+6
-0
No files found.
extensions/swiftmailer/yii/swiftmailer/Message.php
View file @
d33519e3
...
@@ -49,6 +49,14 @@ class Message extends BaseMessage
...
@@ -49,6 +49,14 @@ 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
setTo
(
$to
)
...
@@ -57,6 +65,14 @@ class Message extends BaseMessage
...
@@ -57,6 +65,14 @@ class Message extends BaseMessage
}
}
/**
/**
* @return array To addresses of this message.
*/
public
function
getTo
()
{
return
$this
->
getSwiftMessage
()
->
getTo
();
}
/**
* @inheritdoc
* @inheritdoc
*/
*/
public
function
setCc
(
$cc
)
public
function
setCc
(
$cc
)
...
@@ -65,6 +81,14 @@ class Message extends BaseMessage
...
@@ -65,6 +81,14 @@ class Message extends BaseMessage
}
}
/**
/**
* @return array Cc address of this message.
*/
public
function
getCc
()
{
return
$this
->
getSwiftMessage
()
->
getCc
();
}
/**
* @inheritdoc
* @inheritdoc
*/
*/
public
function
setBcc
(
$bcc
)
public
function
setBcc
(
$bcc
)
...
@@ -73,6 +97,14 @@ class Message extends BaseMessage
...
@@ -73,6 +97,14 @@ class Message extends BaseMessage
}
}
/**
/**
* @return array Bcc addresses of this message.
*/
public
function
getBcc
()
{
return
$this
->
getSwiftMessage
()
->
getBcc
();
}
/**
* @inheritdoc
* @inheritdoc
*/
*/
public
function
setSubject
(
$subject
)
public
function
setSubject
(
$subject
)
...
@@ -81,6 +113,14 @@ class Message extends BaseMessage
...
@@ -81,6 +113,14 @@ class Message extends BaseMessage
}
}
/**
/**
* @return string the subject of this message.
*/
public
function
getSubject
()
{
return
$this
->
getSwiftMessage
()
->
getSubject
();
}
/**
* @inheritdoc
* @inheritdoc
*/
*/
public
function
setText
(
$text
)
public
function
setText
(
$text
)
...
@@ -123,4 +163,12 @@ class Message extends BaseMessage
...
@@ -123,4 +163,12 @@ class Message extends BaseMessage
$attachment
=
\Swift_Attachment
::
newInstance
(
$content
,
$fileName
,
$contentType
);
$attachment
=
\Swift_Attachment
::
newInstance
(
$content
,
$fileName
,
$contentType
);
$this
->
getSwiftMessage
()
->
attach
(
$attachment
);
$this
->
getSwiftMessage
()
->
attach
(
$attachment
);
}
}
/**
* @inheritdoc
*/
public
function
__toString
()
{
return
$this
->
getSwiftMessage
()
->
toString
();
}
}
}
\ No newline at end of file
framework/yii/mail/MessageInterface.php
View file @
d33519e3
...
@@ -113,4 +113,11 @@ interface MessageInterface
...
@@ -113,4 +113,11 @@ interface MessageInterface
* @return string string the rendering result
* @return string string the rendering result
*/
*/
public
function
render
(
$view
,
$params
=
[]);
public
function
render
(
$view
,
$params
=
[]);
/**
* String output.
* This is PHP magic method that returns string representation of an object.
* @return string the string representation of the object
*/
public
function
__toString
();
}
}
\ No newline at end of file
tests/unit/framework/mail/BaseMailerTest.php
View file @
d33519e3
...
@@ -188,4 +188,9 @@ class Message extends BaseMessage
...
@@ -188,4 +188,9 @@ class Message extends BaseMessage
public
function
addHtml
(
$html
)
{}
public
function
addHtml
(
$html
)
{}
public
function
attachContentAsFile
(
$content
,
$fileName
,
$contentType
=
'application/octet-stream'
)
{}
public
function
attachContentAsFile
(
$content
,
$fileName
,
$contentType
=
'application/octet-stream'
)
{}
public
function
__toString
()
{
return
get_class
(
$this
);
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment