forked from desaiuditd/TweetUdit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tweet.php
71 lines (58 loc) · 1.9 KB
/
Tweet.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
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
class Tweet {
private $id;
private $text;
private $created_by;
private $creater_profile_image;
private $created_at;
public function __construct($id, $text, $created_by, $creater_profile_image, $created_at) {
$this->id = $id;
$this->text = $text;
$this->created_by = $created_by;
$this->creater_profile_image = $creater_profile_image;
$timestamp = new DateTime($created_at);
$timestamp->setTimezone(new DateTimeZone("Asia/Kolkata"));
$this->created_at = $timestamp->format("D M-d,Y H:i:s");
}
public function get_id() {
return $this->id;
}
public function set_id($id) {
$this->id = $id;
}
public function get_text() {
return $this->text;
}
public function set_text($text) {
$this->text = $text;
}
public function get_created_by() {
return $this->created_by;
}
public function set_created_by($created_by) {
$this->created_by = $created_by;
}
public function get_creater_profile_image() {
return $this->creater_profile_image;
}
public function set_creater_profile_image($creater_profile_image) {
$this->creater_profile_image = $creater_profile_image;
}
public function get_created_at() {
return $this->created_at;
}
public function set_created_at($created_at) {
$this->created_at = $created_at;
}
public function jsonSerialize() {
return array('id'=> $this->id,
'text'=> $this->text,
'created_by'=> $this->created_by,
'creater_profile_image'=> $this->creater_profile_image,
'created_at'=> $this->created_at);
}
}