1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace PhpEarth\Stats\Model; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Class Reply |
7
|
|
|
* @package PhpEarth\Stats\Model |
8
|
|
|
*/ |
9
|
|
|
class Reply |
10
|
|
|
{ |
11
|
|
|
/** |
12
|
|
|
* @var int Reply's id. |
13
|
|
|
*/ |
14
|
|
|
private $id; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* @var User Reply's author. |
18
|
|
|
*/ |
19
|
|
|
private $user; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* @var Comment Reply's parent comment. |
23
|
|
|
*/ |
24
|
|
|
private $comment; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @var string Reply's created time. |
28
|
|
|
*/ |
29
|
|
|
private $createdTime; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @var int |
33
|
|
|
*/ |
34
|
|
|
private $reactionsCount = 0; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @var string|null |
38
|
|
|
*/ |
39
|
|
|
private $message = null; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @var int Topic id in which reply was created |
43
|
|
|
*/ |
44
|
|
|
private $topicId; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @var int Comment id in which reply was created |
48
|
|
|
*/ |
49
|
|
|
private $commentId; |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* Set reply's id. |
53
|
|
|
* |
54
|
|
|
* @param int $id |
55
|
|
|
*/ |
56
|
|
|
public function setId($id) |
57
|
|
|
{ |
58
|
|
|
$this->id = $id; |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Get reply's id. |
63
|
|
|
* |
64
|
|
|
* @return int |
65
|
|
|
*/ |
66
|
|
|
public function getId() |
67
|
|
|
{ |
68
|
|
|
return $this->id; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* Set reply's author. |
73
|
|
|
* |
74
|
|
|
* @param User $user |
75
|
|
|
*/ |
76
|
|
|
public function setUser(User $user) |
77
|
|
|
{ |
78
|
|
|
$this->user = $user; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* Get reply's author. |
83
|
|
|
* |
84
|
|
|
* @return User |
85
|
|
|
*/ |
86
|
|
|
public function getUser() |
87
|
|
|
{ |
88
|
|
|
return $this->user; |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* Set reply's parent comment object. |
93
|
|
|
* |
94
|
|
|
* @param Comment $comment |
95
|
|
|
*/ |
96
|
|
|
public function setComment(Comment $comment) |
97
|
|
|
{ |
98
|
|
|
$this->comment = $comment; |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
/** |
102
|
|
|
* Get reply's parent comment object. |
103
|
|
|
* |
104
|
|
|
* @return Comment |
105
|
|
|
*/ |
106
|
|
|
public function getComment() |
107
|
|
|
{ |
108
|
|
|
return $this->comment; |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
/** |
112
|
|
|
* Set reply's created time. |
113
|
|
|
* |
114
|
|
|
* @param string $createdTime |
115
|
|
|
*/ |
116
|
|
|
public function setCreatedTime($createdTime) |
117
|
|
|
{ |
118
|
|
|
$this->createdTime = $createdTime; |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
/** |
122
|
|
|
* Get reply's created time. |
123
|
|
|
* |
124
|
|
|
* @return string |
125
|
|
|
*/ |
126
|
|
|
public function getCreatedTime() |
127
|
|
|
{ |
128
|
|
|
return $this->createdTime; |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
/** |
132
|
|
|
* Set reply message |
133
|
|
|
* |
134
|
|
|
* @param string $message |
135
|
|
|
*/ |
136
|
|
|
public function setMessage($message) |
137
|
|
|
{ |
138
|
|
|
$this->message = $message; |
139
|
|
|
} |
140
|
|
|
|
141
|
|
|
/** |
142
|
|
|
* Get reply message. |
143
|
|
|
* |
144
|
|
|
* @return string |
145
|
|
|
*/ |
146
|
|
|
public function getMessage() |
147
|
|
|
{ |
148
|
|
|
return $this->message; |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
/** |
152
|
|
|
* Set number of reply's reactions. |
153
|
|
|
* |
154
|
|
|
* @param int $reactionsCount |
155
|
|
|
*/ |
156
|
|
|
public function setReactionsCount($reactionsCount) |
157
|
|
|
{ |
158
|
|
|
$this->reactionsCount = $reactionsCount; |
159
|
|
|
} |
160
|
|
|
|
161
|
|
|
/** |
162
|
|
|
* Get number of reply's reactions. |
163
|
|
|
* |
164
|
|
|
* @return int |
165
|
|
|
*/ |
166
|
|
|
public function getReactionsCount() |
167
|
|
|
{ |
168
|
|
|
return $this->reactionsCount; |
169
|
|
|
} |
170
|
|
|
|
171
|
|
|
/** |
172
|
|
|
* Set topic id. |
173
|
|
|
* |
174
|
|
|
* @param int $topicId |
175
|
|
|
*/ |
176
|
|
|
public function setTopicId($topicId) |
177
|
|
|
{ |
178
|
|
|
$this->topicId = $topicId; |
179
|
|
|
} |
180
|
|
|
|
181
|
|
|
/** |
182
|
|
|
* Get topic id. |
183
|
|
|
* |
184
|
|
|
* @return int |
185
|
|
|
*/ |
186
|
|
|
public function getTopicId() |
187
|
|
|
{ |
188
|
|
|
return $this->topicId; |
189
|
|
|
} |
190
|
|
|
|
191
|
|
|
/** |
192
|
|
|
* Set comment id. |
193
|
|
|
* |
194
|
|
|
* @param int $commentId |
195
|
|
|
*/ |
196
|
|
|
public function setCommentId($commentId) |
197
|
|
|
{ |
198
|
|
|
$this->commentId = $commentId; |
199
|
|
|
} |
200
|
|
|
|
201
|
|
|
/** |
202
|
|
|
* Get comment id. |
203
|
|
|
* |
204
|
|
|
* @return int |
205
|
|
|
*/ |
206
|
|
|
public function getCommentId() |
207
|
|
|
{ |
208
|
|
|
return $this->commentId; |
209
|
|
|
} |
210
|
|
|
} |
211
|
|
|
|