-
Notifications
You must be signed in to change notification settings - Fork 183
/
ThreadInterface.php
139 lines (119 loc) · 3.13 KB
/
ThreadInterface.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?php
namespace Ornicar\MessageBundle\Model;
use Ornicar\MessageBundle\Model\ParticipantInterface;
interface ThreadInterface extends ReadableInterface
{
/**
* Gets the message unique id
*
* @return mixed
*/
function getId();
/**
* @return string
*/
function getSubject();
/**
* @param string
* @return null
*/
function setSubject($subject);
/**
* Gets the messages contained in the thread
*
* @return array of MessageInterface
*/
function getMessages();
/**
* Adds a new message to the thread
*
* @param MessageInterface $message
*/
function addMessage(MessageInterface $message);
/**
* Gets the first message of the thread
*
* @return MessageInterface the first message
*/
function getFirstMessage();
/**
* Gets the last message of the thread
*
* @return MessageInterface the last message
*/
function getLastMessage();
/**
* Gets the participant that created the thread
* Generally the sender of the first message
*
* @return ParticipantInterface
*/
function getCreatedBy();
/**
* Sets the participant that created the thread
* Generally the sender of the first message
*
* @param ParticipantInterface
*/
function setCreatedBy(ParticipantInterface $participant);
/**
* Gets the date this thread was created at
* Generally the date of the first message
*
* @return DateTime
*/
function getCreatedAt();
/**
* Sets the date this thread was created at
* Generally the date of the first message
*
* @param DateTime
*/
function setCreatedAt(\DateTime $createdAt);
/**
* Gets the users participating in this conversation
*
* @return array of ParticipantInterface
*/
function getParticipants();
/**
* Tells if the user participates to the conversation
*
* @param ParticipantInterface $participant
* @return boolean
*/
function isParticipant(ParticipantInterface $participant);
/**
* Adds a participant to the thread
* If it already exists, nothing is done.
*
* @param ParticipantInterface $participant
* @return null
*/
function addParticipant(ParticipantInterface $participant);
/**
* Tells if this thread is deleted by this participant
*
* @return bool
*/
function isDeletedByParticipant(ParticipantInterface $participant);
/**
* Sets whether or not this participant has deleted this thread
*
* @param ParticipantInterface $participant
* @param boolean $isDeleted
*/
function setIsDeletedByParticipant(ParticipantInterface $participant, $isDeleted);
/**
* Sets the thread as deleted or not deleted for all participants
*
* @param boolean $isDeleted
*/
function setIsDeleted($isDeleted);
/**
* Get the participants this participant is talking with.
*
* @return array of ParticipantInterface
*/
function getOtherParticipants(ParticipantInterface $participant);
}