1 | <?php |
||
5 | class Room |
||
6 | { |
||
7 | protected $id; |
||
8 | |||
9 | protected $xmppJid; |
||
10 | |||
11 | //protected $statistics; |
||
12 | |||
13 | protected $name; |
||
14 | |||
15 | protected $links; |
||
16 | |||
17 | protected $created; |
||
18 | |||
19 | protected $archived; |
||
20 | |||
21 | protected $privacy; |
||
22 | |||
23 | protected $guestAccessible; |
||
24 | |||
25 | protected $topic; |
||
26 | |||
27 | protected $participants; |
||
28 | |||
29 | protected $owner; |
||
30 | |||
31 | protected $guestAccessUrl; |
||
32 | |||
33 | /** |
||
34 | * Builds a room object from server response if json given, otherwise creates an empty object |
||
35 | * |
||
36 | * @param array $json json_decoded response in json given by the server |
||
37 | * |
||
38 | * @return self |
||
|
|||
39 | */ |
||
40 | public function __construct($json = null) |
||
49 | |||
50 | /** |
||
51 | * Parses response given by the API and maps the fields to Room object |
||
52 | * |
||
53 | * @param array $json json_decoded response in json given by the server |
||
54 | * |
||
55 | * @return void |
||
56 | */ |
||
57 | public function parseJson($json) |
||
79 | |||
80 | /** |
||
81 | * Serializes Room object |
||
82 | * |
||
83 | * @return array |
||
84 | */ |
||
85 | public function toJson() |
||
105 | |||
106 | /** |
||
107 | * Sets id |
||
108 | * |
||
109 | * @param integer $id The id to be set |
||
110 | * |
||
111 | * @return self |
||
112 | */ |
||
113 | public function setId($id) |
||
118 | |||
119 | /** |
||
120 | * Returns id |
||
121 | * |
||
122 | * @return integer |
||
123 | */ |
||
124 | public function getId() |
||
128 | |||
129 | /** |
||
130 | * Sets XMPP/Jabber ID of the room |
||
131 | * |
||
132 | * @param string $xmppJid XMPP/Jabber ID of the room |
||
133 | * |
||
134 | * @return self |
||
135 | */ |
||
136 | public function setXmppJid($xmppJid) |
||
141 | |||
142 | /** |
||
143 | * Returns XMPP/Jabber ID of the room |
||
144 | * |
||
145 | * @return string |
||
146 | */ |
||
147 | public function getXmppJid() |
||
151 | |||
152 | /** |
||
153 | * Sets name of the room |
||
154 | * |
||
155 | * @param mixed $name Name of the room. |
||
156 | * |
||
157 | * @return self |
||
158 | */ |
||
159 | public function setName($name) |
||
164 | |||
165 | /** |
||
166 | * Returns Name of the room |
||
167 | * |
||
168 | * @return string |
||
169 | */ |
||
170 | public function getName() |
||
174 | |||
175 | /** |
||
176 | * Sets URLs to retrieve room information |
||
177 | * |
||
178 | * @param array $links URLs to retrieve room information |
||
179 | * |
||
180 | * @return self |
||
181 | */ |
||
182 | public function setLinks($links) |
||
187 | |||
188 | /** |
||
189 | * Returns URLs to retrieve room information |
||
190 | * |
||
191 | * @return array |
||
192 | */ |
||
193 | public function getLinks() |
||
197 | |||
198 | /** |
||
199 | * Sets time the room was created in UTC |
||
200 | * |
||
201 | * @param \Datetime $created Time the room was created in UTC |
||
202 | * |
||
203 | * @return self |
||
204 | */ |
||
205 | public function setCreated($created) |
||
210 | |||
211 | /** |
||
212 | * Returns time the room was created in UTC |
||
213 | * |
||
214 | * @return \Datetime |
||
215 | */ |
||
216 | public function getCreated() |
||
220 | |||
221 | /** |
||
222 | * Sets whether or not this room is archived |
||
223 | * |
||
224 | * @param boolean $archived Whether or not this room is archived |
||
225 | * |
||
226 | * @return self |
||
227 | */ |
||
228 | public function setArchived($archived) |
||
233 | |||
234 | /** |
||
235 | * Returns if is archived or not |
||
236 | * |
||
237 | * @return mixed |
||
238 | */ |
||
239 | public function isArchived() |
||
243 | |||
244 | /** |
||
245 | * Sets Privacy setting |
||
246 | * |
||
247 | * @param string $privacy Privacy setting. Valid values: public | private |
||
248 | * |
||
249 | * @return self |
||
250 | */ |
||
251 | public function setPrivacy($privacy) |
||
256 | |||
257 | /** |
||
258 | * Returns privacy setting |
||
259 | * |
||
260 | * @return string public | private |
||
261 | */ |
||
262 | public function getPrivacy() |
||
266 | |||
267 | /** |
||
268 | * Sets whether or not guests can access this room |
||
269 | * |
||
270 | * @param boolean $guestAccessible Whether or not guests can access this room |
||
271 | * |
||
272 | * @return self |
||
273 | */ |
||
274 | public function setGuestAccessible($guestAccessible) |
||
279 | |||
280 | /** |
||
281 | * Returns whether or not guests can access this room |
||
282 | * |
||
283 | * @return boolean |
||
284 | */ |
||
285 | public function isGuestAccessible() |
||
289 | |||
290 | /** |
||
291 | * Sets current topic |
||
292 | * |
||
293 | * @param string $topic Current topic |
||
294 | * |
||
295 | * @return self |
||
296 | */ |
||
297 | public function setTopic($topic) |
||
302 | |||
303 | /** |
||
304 | * Returns current topic |
||
305 | * |
||
306 | * @return string |
||
307 | */ |
||
308 | public function getTopic() |
||
312 | |||
313 | /** |
||
314 | * Sets list of current room participants |
||
315 | * |
||
316 | * @param array $participants List of current room participants |
||
317 | * |
||
318 | * @return self |
||
319 | */ |
||
320 | public function setParticipants($participants) |
||
325 | |||
326 | /** |
||
327 | * Returns list of current room participants |
||
328 | * |
||
329 | * @return array of User |
||
330 | */ |
||
331 | public function getParticipants() |
||
335 | |||
336 | /** |
||
337 | * Sets the room owner |
||
338 | * |
||
339 | * @param User $owner The room owner |
||
340 | * |
||
341 | * @return self |
||
342 | */ |
||
343 | public function setOwner($owner) |
||
348 | |||
349 | /** |
||
350 | * Returns the room owner |
||
351 | * |
||
352 | * @return User |
||
353 | */ |
||
354 | public function getOwner() |
||
358 | |||
359 | /** |
||
360 | * Sets URL for guest access |
||
361 | * |
||
362 | * @param string $guestAccessUrl URL for guest access |
||
363 | * |
||
364 | * @return self |
||
365 | */ |
||
366 | public function setGuestAccessUrl($guestAccessUrl) |
||
371 | |||
372 | /** |
||
373 | * Returns URL for guest access, if enabled |
||
374 | * |
||
375 | * @return string | null |
||
376 | */ |
||
377 | public function getGuestAccessUrl() |
||
381 | } |
||
382 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.