1 | <?php |
||
10 | class Tweet |
||
11 | { |
||
12 | /** |
||
13 | * @var bigint |
||
14 | */ |
||
15 | private $id; |
||
16 | |||
17 | /** |
||
18 | * @var \DateTime |
||
19 | */ |
||
20 | private $created_at; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | private $text; |
||
26 | |||
27 | /** |
||
28 | * @var integer |
||
29 | */ |
||
30 | private $retweet_count = 0; |
||
31 | |||
32 | /** |
||
33 | * @var integer |
||
34 | */ |
||
35 | private $favorite_count = 0; |
||
36 | |||
37 | /** |
||
38 | * @var User |
||
39 | */ |
||
40 | private $user; |
||
41 | |||
42 | /** |
||
43 | * In timeline: false for retweeted Tweets |
||
44 | */ |
||
45 | private $in_timeline = false; |
||
46 | |||
47 | /** |
||
48 | * @var Tweet |
||
49 | */ |
||
50 | private $retweeted_status = null; |
||
51 | |||
52 | /** |
||
53 | * @var ArrayCollection |
||
54 | */ |
||
55 | private $retweeting_statuses; |
||
56 | |||
57 | /** |
||
58 | * @var ArrayCollection |
||
59 | */ |
||
60 | private $medias; |
||
61 | |||
62 | 7 | public function __construct($id = null) |
|
71 | |||
72 | /** |
||
73 | * Set id |
||
74 | * |
||
75 | * @param bigint $id |
||
76 | * @return Tweet |
||
77 | */ |
||
78 | 7 | public function setId($id) |
|
84 | |||
85 | /** |
||
86 | * Get id |
||
87 | * |
||
88 | * @return integer |
||
89 | */ |
||
90 | 9 | public function getId() |
|
94 | |||
95 | /** |
||
96 | * Set created_at |
||
97 | * |
||
98 | * @param \DateTime $createdAt |
||
99 | * @return Tweet |
||
100 | */ |
||
101 | 7 | public function setCreatedAt(\Datetime $createdAt) |
|
107 | |||
108 | /** |
||
109 | * Get created_at |
||
110 | * |
||
111 | * @return \DateTime |
||
112 | */ |
||
113 | 10 | public function getCreatedAt() |
|
117 | |||
118 | /** |
||
119 | * Set text |
||
120 | * |
||
121 | * @param string $text |
||
122 | * @return Tweet |
||
123 | */ |
||
124 | 7 | public function setText($text) |
|
130 | |||
131 | /** |
||
132 | * Get text |
||
133 | * |
||
134 | * @return string |
||
135 | */ |
||
136 | 10 | public function getText() |
|
140 | |||
141 | 6 | public function getTextLinkified() |
|
150 | |||
151 | /** |
||
152 | * Set retweet_count |
||
153 | * |
||
154 | * @param integer $retweetCount |
||
155 | * @return Tweet |
||
156 | */ |
||
157 | 7 | public function setRetweetCount($retweetCount) |
|
163 | |||
164 | /** |
||
165 | * Get retweet_count |
||
166 | * |
||
167 | * @return integer |
||
168 | */ |
||
169 | 8 | public function getRetweetCount() |
|
173 | |||
174 | /** |
||
175 | * Set favorite_count |
||
176 | * |
||
177 | * @param integer $favoriteCount |
||
178 | * @return Tweet |
||
179 | */ |
||
180 | 7 | public function setFavoriteCount($favoriteCount) |
|
186 | |||
187 | /** |
||
188 | * Get favorite_count |
||
189 | * |
||
190 | * @return integer |
||
191 | */ |
||
192 | 8 | public function getFavoriteCount() |
|
196 | |||
197 | /** |
||
198 | * Set user |
||
199 | * |
||
200 | * @param User $user |
||
201 | * @return Tweet |
||
202 | */ |
||
203 | 7 | public function setUser(User $user) |
|
210 | |||
211 | /** |
||
212 | * Get User |
||
213 | * |
||
214 | * @return User |
||
215 | */ |
||
216 | 8 | public function getUser() |
|
220 | |||
221 | /** |
||
222 | * Set in timeline |
||
223 | * |
||
224 | * @param boolean $inTimeline |
||
225 | * @return Tweet |
||
226 | */ |
||
227 | 7 | public function setInTimeline($inTimeline) |
|
233 | |||
234 | /** |
||
235 | * Get in timeline |
||
236 | * |
||
237 | * @return boolean |
||
238 | */ |
||
239 | 3 | public function isInTimeline() |
|
243 | |||
244 | /** |
||
245 | * Set retweeted |
||
246 | * "This attribute contains a representation of the original Tweet |
||
247 | * that was retweeted." |
||
248 | * |
||
249 | * @param Tweet $retweetedStatus |
||
250 | * @return Tweet |
||
251 | */ |
||
252 | 6 | public function setRetweetedStatus(Tweet $retweetedStatus) |
|
258 | |||
259 | /** |
||
260 | * Get retweeted status |
||
261 | * |
||
262 | * @return Tweet |
||
263 | */ |
||
264 | 7 | public function getRetweetedStatus() |
|
268 | |||
269 | /** |
||
270 | * Get medias |
||
271 | * |
||
272 | * @return ArrayCollection |
||
273 | */ |
||
274 | 6 | public function getMedias() |
|
278 | |||
279 | /** |
||
280 | * Add a media |
||
281 | * |
||
282 | * @return Tweet |
||
283 | */ |
||
284 | 6 | public function addMedia(Media $media) |
|
291 | |||
292 | /** |
||
293 | * Remove a media |
||
294 | * |
||
295 | * @return Tweet |
||
296 | */ |
||
297 | 1 | public function removeMedia(Media $media) |
|
304 | |||
305 | /** |
||
306 | * Get retweeting status |
||
307 | * |
||
308 | * @return ArrayCollection |
||
309 | */ |
||
310 | 2 | public function getRetweetingStatuses() |
|
314 | |||
315 | /** |
||
316 | * Call setter functions |
||
317 | * |
||
318 | * @param \stdClass $tweetTmp |
||
319 | */ |
||
320 | 3 | public function setValues(\stdClass $tweetTmp) |
|
331 | |||
332 | /** |
||
333 | * Check that tweet can be deleted |
||
334 | * |
||
335 | * @param integer $tweetId |
||
336 | * |
||
337 | * @return boolean |
||
338 | */ |
||
339 | 2 | public function mustBeKept($tweetId) |
|
356 | } |
||
357 |