1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace allejo\DaPulse; |
4
|
|
|
|
5
|
|
|
use allejo\DaPulse\Objects\ApiObject; |
6
|
|
|
|
7
|
|
|
class PulseUpdate extends ApiObject |
|
|
|
|
8
|
|
|
{ |
9
|
|
|
/** |
10
|
|
|
* User who wrote the update. |
11
|
|
|
* |
12
|
|
|
* @var array|PulseUser |
13
|
|
|
*/ |
14
|
|
|
protected $user; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* The resource's URL. |
18
|
|
|
* |
19
|
|
|
* @var string |
20
|
|
|
*/ |
21
|
|
|
protected $url; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* The update's id. |
25
|
|
|
* |
26
|
|
|
* @var string |
27
|
|
|
*/ |
28
|
|
|
protected $id; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* The update's body. |
32
|
|
|
* |
33
|
|
|
* @var string |
34
|
|
|
*/ |
35
|
|
|
protected $body; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* The update's body in plain text |
39
|
|
|
* |
40
|
|
|
* @var string |
41
|
|
|
*/ |
42
|
|
|
protected $body_text; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* The replies made to this update. |
46
|
|
|
* |
47
|
|
|
* @var array |
48
|
|
|
*/ |
49
|
|
|
protected $replies; |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* The update's kind. |
53
|
|
|
* |
54
|
|
|
* @var string |
55
|
|
|
*/ |
56
|
|
|
protected $kind; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* The update's has_assets. |
60
|
|
|
* |
61
|
|
|
* @var string |
62
|
|
|
*/ |
63
|
|
|
protected $has_assets; |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* The update's assets. |
67
|
|
|
* |
68
|
|
|
* @var string |
69
|
|
|
*/ |
70
|
|
|
protected $assets; |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* The users who watch this update. |
74
|
|
|
* |
75
|
|
|
* @var array |
76
|
|
|
*/ |
77
|
|
|
protected $watched; |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* Creation time. |
81
|
|
|
* |
82
|
|
|
* @var \DateTime |
83
|
|
|
*/ |
84
|
|
|
protected $created_at; |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* Last update time. |
88
|
|
|
* |
89
|
|
|
* @var \DateTime |
90
|
|
|
*/ |
91
|
|
|
protected $updated_at; |
92
|
|
|
|
93
|
|
|
// ================================================================================================================ |
94
|
|
|
// Getter functions |
95
|
|
|
// ================================================================================================================ |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* User who wrote the update. |
99
|
|
|
* |
100
|
|
|
* @return PulseUser |
101
|
|
|
*/ |
102
|
|
|
public function getUser() |
103
|
|
|
{ |
104
|
|
|
self::lazyLoad($this->user, "PulseUser"); |
105
|
|
|
|
106
|
|
|
return $this->user; |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* The resource's URL. |
111
|
|
|
* |
112
|
|
|
* @return string |
113
|
|
|
*/ |
114
|
|
|
public function getUrl() |
115
|
|
|
{ |
116
|
|
|
return $this->url; |
117
|
|
|
} |
118
|
|
|
|
119
|
|
|
/** |
120
|
|
|
* The update's id. |
121
|
|
|
* |
122
|
|
|
* @return string |
123
|
|
|
*/ |
124
|
|
|
public function getId() |
125
|
|
|
{ |
126
|
|
|
return $this->id; |
127
|
|
|
} |
128
|
|
|
|
129
|
|
|
/** |
130
|
|
|
* The update's body. |
131
|
|
|
* |
132
|
|
|
* @return string |
133
|
|
|
*/ |
134
|
|
|
public function getBody() |
135
|
|
|
{ |
136
|
|
|
return $this->body; |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
/** |
140
|
|
|
* The update's body in plain text |
141
|
|
|
* |
142
|
|
|
* @return string |
143
|
|
|
*/ |
144
|
|
|
public function getBodyText() |
145
|
|
|
{ |
146
|
|
|
return $this->body_text; |
147
|
|
|
} |
148
|
|
|
|
149
|
|
|
/** |
150
|
|
|
* The replies made to this update. |
151
|
|
|
* |
152
|
|
|
* @return static[] |
153
|
|
|
*/ |
154
|
|
|
public function getReplies() |
155
|
|
|
{ |
156
|
|
|
self::lazyArray($this->replies, "PulseUpdate"); |
157
|
|
|
|
158
|
|
|
return $this->replies; |
159
|
|
|
} |
160
|
|
|
|
161
|
|
|
/** |
162
|
|
|
* The update's kind. |
163
|
|
|
* |
164
|
|
|
* @return string |
165
|
|
|
*/ |
166
|
|
|
public function getKind() |
167
|
|
|
{ |
168
|
|
|
return $this->kind; |
169
|
|
|
} |
170
|
|
|
|
171
|
|
|
/** |
172
|
|
|
* The update's has_assets. |
173
|
|
|
* |
174
|
|
|
* @return string |
175
|
|
|
*/ |
176
|
|
|
public function getHasAssets() |
177
|
|
|
{ |
178
|
|
|
return $this->has_assets; |
179
|
|
|
} |
180
|
|
|
|
181
|
|
|
/** |
182
|
|
|
* The update's assets. |
183
|
|
|
* |
184
|
|
|
* @return string |
185
|
|
|
*/ |
186
|
|
|
public function getAssets() |
187
|
|
|
{ |
188
|
|
|
return $this->assets; |
189
|
|
|
} |
190
|
|
|
|
191
|
|
|
/** |
192
|
|
|
* Creation time. |
193
|
|
|
* |
194
|
|
|
* @return \DateTime |
195
|
|
|
*/ |
196
|
|
|
public function getCreatedAt() |
197
|
|
|
{ |
198
|
|
|
return $this->created_at; |
199
|
|
|
} |
200
|
|
|
|
201
|
|
|
/** |
202
|
|
|
* Last update time. |
203
|
|
|
* |
204
|
|
|
* @return \DateTime |
205
|
|
|
*/ |
206
|
|
|
public function getUpdatedAt() |
207
|
|
|
{ |
208
|
|
|
return $this->updated_at; |
209
|
|
|
} |
210
|
|
|
|
211
|
|
|
/** |
212
|
|
|
* Get the users watching this update |
213
|
|
|
* |
214
|
|
|
* @return PulseUser[] |
215
|
|
|
*/ |
216
|
|
|
public function getWatchers () |
217
|
|
|
{ |
218
|
|
|
parent::lazyArray($this->watched, "PulseUser"); |
|
|
|
|
219
|
|
|
|
220
|
|
|
return $this->watched; |
221
|
|
|
} |
222
|
|
|
} |
This check marks property names that have not been written in camelCase.
In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes
databaseConnectionString
.