|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Copyright 2017 Facebook, Inc. |
|
4
|
|
|
* |
|
5
|
|
|
* You are hereby granted a non-exclusive, worldwide, royalty-free license to |
|
6
|
|
|
* use, copy, modify, and distribute this software in source code or binary |
|
7
|
|
|
* form for use in connection with the web services and APIs provided by |
|
8
|
|
|
* Facebook. |
|
9
|
|
|
* |
|
10
|
|
|
* As with any software that integrates with the Facebook platform, your use |
|
11
|
|
|
* of this software is subject to the Facebook Developer Principles and |
|
12
|
|
|
* Policies [http://developers.facebook.com/policy/]. This copyright notice |
|
13
|
|
|
* shall be included in all copies or substantial portions of the software. |
|
14
|
|
|
* |
|
15
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
16
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
17
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
|
18
|
|
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
19
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
20
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
|
21
|
|
|
* DEALINGS IN THE SOFTWARE. |
|
22
|
|
|
*/ |
|
23
|
|
|
namespace Facebook\GraphNode; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* @package Facebook |
|
27
|
|
|
*/ |
|
28
|
|
|
class GraphEvent extends GraphNode |
|
29
|
|
|
{ |
|
30
|
|
|
/** |
|
31
|
|
|
* @var array maps object key names to GraphNode types |
|
32
|
|
|
*/ |
|
33
|
|
|
protected static $graphNodeMap = [ |
|
34
|
|
|
'cover' => GraphCoverPhoto::class, |
|
35
|
|
|
'place' => GraphPage::class, |
|
36
|
|
|
'picture' => GraphPicture::class, |
|
37
|
|
|
'parent_group' => GraphGroup::class, |
|
38
|
|
|
]; |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* Returns the `id` (The event ID) as string if present. |
|
42
|
|
|
* |
|
43
|
|
|
* @return null|string |
|
44
|
|
|
*/ |
|
45
|
|
|
public function getId() |
|
46
|
|
|
{ |
|
47
|
|
|
return $this->getField('id'); |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* Returns the `cover` (Cover picture) as GraphCoverPhoto if present. |
|
52
|
|
|
* |
|
53
|
|
|
* @return null|GraphCoverPhoto |
|
54
|
|
|
*/ |
|
55
|
1 |
|
public function getCover() |
|
56
|
|
|
{ |
|
57
|
1 |
|
return $this->getField('cover'); |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* Returns the `description` (Long-form description) as string if present. |
|
62
|
|
|
* |
|
63
|
|
|
* @return null|string |
|
64
|
|
|
*/ |
|
65
|
|
|
public function getDescription() |
|
66
|
|
|
{ |
|
67
|
|
|
return $this->getField('description'); |
|
68
|
|
|
} |
|
69
|
|
|
|
|
70
|
|
|
/** |
|
71
|
|
|
* Returns the `end_time` (End time, if one has been set) as DateTime if present. |
|
72
|
|
|
* |
|
73
|
|
|
* @return null|\DateTime |
|
74
|
|
|
*/ |
|
75
|
|
|
public function getEndTime() |
|
76
|
|
|
{ |
|
77
|
|
|
return $this->getField('end_time'); |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* Returns the `is_date_only` (Whether the event only has a date specified, but no time) as bool if present. |
|
82
|
|
|
* |
|
83
|
|
|
* @return null|bool |
|
84
|
|
|
*/ |
|
85
|
|
|
public function getIsDateOnly() |
|
86
|
|
|
{ |
|
87
|
|
|
return $this->getField('is_date_only'); |
|
88
|
|
|
} |
|
89
|
|
|
|
|
90
|
|
|
/** |
|
91
|
|
|
* Returns the `name` (Event name) as string if present. |
|
92
|
|
|
* |
|
93
|
|
|
* @return null|string |
|
94
|
|
|
*/ |
|
95
|
|
|
public function getName() |
|
96
|
|
|
{ |
|
97
|
|
|
return $this->getField('name'); |
|
98
|
|
|
} |
|
99
|
|
|
|
|
100
|
|
|
/** |
|
101
|
|
|
* Returns the `owner` (The profile that created the event) as GraphNode if present. |
|
102
|
|
|
* |
|
103
|
|
|
* @return null|GraphNode |
|
104
|
|
|
*/ |
|
105
|
|
|
public function getOwner() |
|
106
|
|
|
{ |
|
107
|
|
|
return $this->getField('owner'); |
|
108
|
|
|
} |
|
109
|
|
|
|
|
110
|
|
|
/** |
|
111
|
|
|
* Returns the `parent_group` (The group the event belongs to) as GraphGroup if present. |
|
112
|
|
|
* |
|
113
|
|
|
* @return null|GraphGroup |
|
114
|
|
|
*/ |
|
115
|
1 |
|
public function getParentGroup() |
|
116
|
|
|
{ |
|
117
|
1 |
|
return $this->getField('parent_group'); |
|
118
|
|
|
} |
|
119
|
|
|
|
|
120
|
|
|
/** |
|
121
|
|
|
* Returns the `place` (Event Place information) as GraphPage if present. |
|
122
|
|
|
* |
|
123
|
|
|
* @return null|GraphPage |
|
124
|
|
|
*/ |
|
125
|
1 |
|
public function getPlace() |
|
126
|
|
|
{ |
|
127
|
1 |
|
return $this->getField('place'); |
|
128
|
|
|
} |
|
129
|
|
|
|
|
130
|
|
|
/** |
|
131
|
|
|
* Returns the `privacy` (Who can see the event) as string if present. |
|
132
|
|
|
* |
|
133
|
|
|
* @return null|string |
|
134
|
|
|
*/ |
|
135
|
|
|
public function getPrivacy() |
|
136
|
|
|
{ |
|
137
|
|
|
return $this->getField('privacy'); |
|
138
|
|
|
} |
|
139
|
|
|
|
|
140
|
|
|
/** |
|
141
|
|
|
* Returns the `start_time` (Start time) as DateTime if present. |
|
142
|
|
|
* |
|
143
|
|
|
* @return null|\DateTime |
|
144
|
|
|
*/ |
|
145
|
|
|
public function getStartTime() |
|
146
|
|
|
{ |
|
147
|
|
|
return $this->getField('start_time'); |
|
148
|
|
|
} |
|
149
|
|
|
|
|
150
|
|
|
/** |
|
151
|
|
|
* Returns the `ticket_uri` (The link users can visit to buy a ticket to this event) as string if present. |
|
152
|
|
|
* |
|
153
|
|
|
* @return null|string |
|
154
|
|
|
*/ |
|
155
|
|
|
public function getTicketUri() |
|
156
|
|
|
{ |
|
157
|
|
|
return $this->getField('ticket_uri'); |
|
158
|
|
|
} |
|
159
|
|
|
|
|
160
|
|
|
/** |
|
161
|
|
|
* Returns the `timezone` (Timezone) as string if present. |
|
162
|
|
|
* |
|
163
|
|
|
* @return null|string |
|
164
|
|
|
*/ |
|
165
|
|
|
public function getTimezone() |
|
166
|
|
|
{ |
|
167
|
|
|
return $this->getField('timezone'); |
|
168
|
|
|
} |
|
169
|
|
|
|
|
170
|
|
|
/** |
|
171
|
|
|
* Returns the `updated_time` (Last update time) as DateTime if present. |
|
172
|
|
|
* |
|
173
|
|
|
* @return null|\DateTime |
|
174
|
|
|
*/ |
|
175
|
|
|
public function getUpdatedTime() |
|
176
|
|
|
{ |
|
177
|
|
|
return $this->getField('updated_time'); |
|
178
|
|
|
} |
|
179
|
|
|
|
|
180
|
|
|
/** |
|
181
|
|
|
* Returns the `picture` (Event picture) as GraphPicture if present. |
|
182
|
|
|
* |
|
183
|
|
|
* @return null|GraphPicture |
|
184
|
|
|
*/ |
|
185
|
1 |
|
public function getPicture() |
|
186
|
|
|
{ |
|
187
|
1 |
|
return $this->getField('picture'); |
|
188
|
|
|
} |
|
189
|
|
|
|
|
190
|
|
|
/** |
|
191
|
|
|
* Returns the `attending_count` (Number of people attending the event) as int if present. |
|
192
|
|
|
* |
|
193
|
|
|
* @return null|int |
|
194
|
|
|
*/ |
|
195
|
|
|
public function getAttendingCount() |
|
196
|
|
|
{ |
|
197
|
|
|
return $this->getField('attending_count'); |
|
198
|
|
|
} |
|
199
|
|
|
|
|
200
|
|
|
/** |
|
201
|
|
|
* Returns the `declined_count` (Number of people who declined the event) as int if present. |
|
202
|
|
|
* |
|
203
|
|
|
* @return null|int |
|
204
|
|
|
*/ |
|
205
|
|
|
public function getDeclinedCount() |
|
206
|
|
|
{ |
|
207
|
|
|
return $this->getField('declined_count'); |
|
208
|
|
|
} |
|
209
|
|
|
|
|
210
|
|
|
/** |
|
211
|
|
|
* Returns the `maybe_count` (Number of people who maybe going to the event) as int if present. |
|
212
|
|
|
* |
|
213
|
|
|
* @return null|int |
|
214
|
|
|
*/ |
|
215
|
|
|
public function getMaybeCount() |
|
216
|
|
|
{ |
|
217
|
|
|
return $this->getField('maybe_count'); |
|
218
|
|
|
} |
|
219
|
|
|
|
|
220
|
|
|
/** |
|
221
|
|
|
* Returns the `noreply_count` (Number of people who did not reply to the event) as int if present. |
|
222
|
|
|
* |
|
223
|
|
|
* @return null|int |
|
224
|
|
|
*/ |
|
225
|
|
|
public function getNoreplyCount() |
|
226
|
|
|
{ |
|
227
|
|
|
return $this->getField('noreply_count'); |
|
228
|
|
|
} |
|
229
|
|
|
|
|
230
|
|
|
/** |
|
231
|
|
|
* Returns the `invited_count` (Number of people invited to the event) as int if present. |
|
232
|
|
|
* |
|
233
|
|
|
* @return null|int |
|
234
|
|
|
*/ |
|
235
|
|
|
public function getInvitedCount() |
|
236
|
|
|
{ |
|
237
|
|
|
return $this->getField('invited_count'); |
|
238
|
|
|
} |
|
239
|
|
|
} |
|
240
|
|
|
|