forked from FriendsOfSymfony/FOSMessageBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NewThreadMessageBuilder.php
54 lines (45 loc) · 1.21 KB
/
NewThreadMessageBuilder.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
namespace FOS\MessageBundle\MessageBuilder;
use FOS\MessageBundle\Model\MessageInterface;
use FOS\MessageBundle\Model\ParticipantInterface;
use FOS\MessageBundle\Sender\SenderInterface;
use Doctrine\Common\Collections\Collection;
/**
* Fluent interface message builder for new thread messages
*
* @author Thibault Duplessis <[email protected]>
*/
class NewThreadMessageBuilder extends AbstractMessageBuilder
{
/**
* The thread subject
*
* @param string
* @return NewThreadMessageBuilder (fluent interface)
*/
public function setSubject($subject)
{
$this->thread->setSubject($subject);
return $this;
}
/**
* @param ParticipantInterface
* @return NewThreadMessageBuilder (fluent interface)
*/
public function addRecipient(ParticipantInterface $recipient)
{
$this->thread->addParticipant($recipient);
return $this;
}
/**
* @param Collection $recipients
* @return NewThreadMessageBuilder
*/
public function addRecipients(Collection $recipients)
{
foreach ($recipients as $recipient) {
$this->addRecipient($recipient);
}
return $this;
}
}