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 GraphGroup extends GraphNode |
29
|
|
|
{ |
30
|
|
|
/** |
31
|
|
|
* @var array maps object key names to GraphNode types |
32
|
|
|
*/ |
33
|
|
|
protected static $graphNodeMap = [ |
34
|
|
|
'cover' => GraphCoverPhoto::class, |
35
|
|
|
'venue' => GraphLocation::class, |
36
|
|
|
]; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* Returns the `id` (The Group ID) as string if present. |
40
|
|
|
* |
41
|
|
|
* @return null|string |
42
|
|
|
*/ |
43
|
|
|
public function getId() |
44
|
|
|
{ |
45
|
|
|
return $this->getField('id'); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* Returns the `cover` (The cover photo of the Group) as GraphCoverPhoto if present. |
50
|
|
|
* |
51
|
|
|
* @return null|GraphCoverPhoto |
52
|
|
|
*/ |
53
|
1 |
|
public function getCover() |
54
|
|
|
{ |
55
|
1 |
|
return $this->getField('cover'); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* Returns the `description` (A brief description of the Group) as string if present. |
60
|
|
|
* |
61
|
|
|
* @return null|string |
62
|
|
|
*/ |
63
|
|
|
public function getDescription() |
64
|
|
|
{ |
65
|
|
|
return $this->getField('description'); |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* Returns the `email` (The email address to upload content to the Group. Only current members of the Group can use this) as string if present. |
70
|
|
|
* |
71
|
|
|
* @return null|string |
72
|
|
|
*/ |
73
|
|
|
public function getEmail() |
74
|
|
|
{ |
75
|
|
|
return $this->getField('email'); |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* Returns the `icon` (The URL for the Group's icon) as string if present. |
80
|
|
|
* |
81
|
|
|
* @return null|string |
82
|
|
|
*/ |
83
|
|
|
public function getIcon() |
84
|
|
|
{ |
85
|
|
|
return $this->getField('icon'); |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* Returns the `link` (The Group's website) as string if present. |
90
|
|
|
* |
91
|
|
|
* @return null|string |
92
|
|
|
*/ |
93
|
|
|
public function getLink() |
94
|
|
|
{ |
95
|
|
|
return $this->getField('link'); |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* Returns the `name` (The name of the Group) as string if present. |
100
|
|
|
* |
101
|
|
|
* @return null|string |
102
|
|
|
*/ |
103
|
|
|
public function getName() |
104
|
|
|
{ |
105
|
|
|
return $this->getField('name'); |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* Returns the `member_request_count` (Number of people asking to join the group.) as int if present. |
110
|
|
|
* |
111
|
|
|
* @return null|int |
112
|
|
|
*/ |
113
|
|
|
public function getMemberRequestCount() |
114
|
|
|
{ |
115
|
|
|
return $this->getField('member_request_count'); |
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
/** |
119
|
|
|
* Returns the `owner` (The profile that created this Group) as GraphNode if present. |
120
|
|
|
* |
121
|
|
|
* @return null|GraphNode |
122
|
|
|
*/ |
123
|
|
|
public function getOwner() |
124
|
|
|
{ |
125
|
|
|
return $this->getField('owner'); |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
/** |
129
|
|
|
* Returns the `parent` (The parent Group of this Group, if it exists) as GraphNode if present. |
130
|
|
|
* |
131
|
|
|
* @return null|GraphNode |
132
|
|
|
*/ |
133
|
|
|
public function getParent() |
134
|
|
|
{ |
135
|
|
|
return $this->getField('parent'); |
136
|
|
|
} |
137
|
|
|
|
138
|
|
|
/** |
139
|
|
|
* Returns the `privacy` (The privacy setting of the Group) as string if present. |
140
|
|
|
* |
141
|
|
|
* @return null|string |
142
|
|
|
*/ |
143
|
|
|
public function getPrivacy() |
144
|
|
|
{ |
145
|
|
|
return $this->getField('privacy'); |
146
|
|
|
} |
147
|
|
|
|
148
|
|
|
/** |
149
|
|
|
* Returns the `updated_time` (The last time the Group was updated (this includes changes in the Group's properties and changes in posts and comments if user can see them)) as \DateTime if present. |
150
|
|
|
* |
151
|
|
|
* @return null|\DateTime |
152
|
|
|
*/ |
153
|
|
|
public function getUpdatedTime() |
154
|
|
|
{ |
155
|
|
|
return $this->getField('updated_time'); |
156
|
|
|
} |
157
|
|
|
|
158
|
|
|
/** |
159
|
|
|
* Returns the `venue` (The location for the Group) as GraphLocation if present. |
160
|
|
|
* |
161
|
|
|
* @return null|GraphLocation |
162
|
|
|
*/ |
163
|
1 |
|
public function getVenue() |
164
|
|
|
{ |
165
|
1 |
|
return $this->getField('venue'); |
166
|
|
|
} |
167
|
|
|
} |
168
|
|
|
|