1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the Slack API library. |
5
|
|
|
* |
6
|
|
|
* (c) Cas Leentfaar <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace CL\Slack\Model; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* @author Cas Leentfaar <[email protected]> |
16
|
|
|
* |
17
|
|
|
* @link Official documentation at https://api.slack.com/types/group |
18
|
|
|
*/ |
19
|
|
|
class Group extends AbstractModel |
20
|
|
|
{ |
21
|
|
|
/** |
22
|
|
|
* @var string |
23
|
|
|
*/ |
24
|
|
|
private $id; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @var string |
28
|
|
|
*/ |
29
|
|
|
private $name; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @var \DateTime |
33
|
|
|
*/ |
34
|
|
|
private $created; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @var string |
38
|
|
|
*/ |
39
|
|
|
private $creator; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @var bool |
43
|
|
|
*/ |
44
|
|
|
private $isArchived; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @var array<string> |
48
|
|
|
*/ |
49
|
|
|
private $members = []; |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @var Customizable |
53
|
|
|
*/ |
54
|
|
|
private $topic; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @var Customizable |
58
|
|
|
*/ |
59
|
|
|
private $purpose; |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* @var bool |
63
|
|
|
*/ |
64
|
|
|
private $isGroup = true; |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @var string |
68
|
|
|
*/ |
69
|
|
|
private $lastRead; |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @var Message |
73
|
|
|
*/ |
74
|
|
|
private $latest; |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @var int |
78
|
|
|
*/ |
79
|
|
|
private $unreadCount; |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* @var int |
83
|
|
|
*/ |
84
|
|
|
private $unreadCountDisplay; |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @return string The ID of this group. |
88
|
|
|
*/ |
89
|
8 |
|
public function getId() |
90
|
|
|
{ |
91
|
8 |
|
return $this->id; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @return string The name of the group, without a leading hash sign. |
96
|
|
|
*/ |
97
|
8 |
|
public function getName() |
98
|
|
|
{ |
99
|
8 |
|
return $this->name; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @return \DateTime The date/time on which this group was created. |
104
|
|
|
*/ |
105
|
8 |
|
public function getCreated() |
106
|
|
|
{ |
107
|
8 |
|
return $this->created; |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
/** |
111
|
|
|
* @return string The user ID of the member that created this group. |
112
|
|
|
*/ |
113
|
8 |
|
public function getCreator() |
114
|
|
|
{ |
115
|
8 |
|
return $this->creator; |
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
/** |
119
|
|
|
* @return bool True if this group has been archived, false otherwise. |
120
|
|
|
*/ |
121
|
8 |
|
public function isArchived() |
122
|
|
|
{ |
123
|
8 |
|
return $this->isArchived; |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
/** |
127
|
|
|
* @return array A list of user ids for all users in this group. |
128
|
|
|
* This includes any disabled accounts that were in this group when they were disabled. |
129
|
|
|
*/ |
130
|
8 |
|
public function getMembers() |
131
|
|
|
{ |
132
|
8 |
|
return $this->members; |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* @return Customizable Information about the group's topic. |
137
|
|
|
*/ |
138
|
8 |
|
public function getTopic() |
139
|
|
|
{ |
140
|
8 |
|
return $this->topic; |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* @return Customizable Information about the group's purpose. |
145
|
|
|
*/ |
146
|
8 |
|
public function getPurpose() |
147
|
|
|
{ |
148
|
8 |
|
return $this->purpose; |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
/** |
152
|
|
|
* @return bool |
153
|
|
|
*/ |
154
|
8 |
|
public function isGroup() |
155
|
|
|
{ |
156
|
8 |
|
return $this->isGroup; |
157
|
|
|
} |
158
|
|
|
|
159
|
|
|
/** |
160
|
|
|
* @return string |
161
|
|
|
*/ |
162
|
8 |
|
public function getLastRead() |
163
|
|
|
{ |
164
|
8 |
|
return $this->lastRead; |
165
|
|
|
} |
166
|
|
|
|
167
|
|
|
/** |
168
|
|
|
* @return Message |
169
|
|
|
*/ |
170
|
8 |
|
public function getLatest() |
171
|
|
|
{ |
172
|
8 |
|
return $this->latest; |
173
|
|
|
} |
174
|
|
|
|
175
|
|
|
/** |
176
|
|
|
* @return int |
177
|
|
|
*/ |
178
|
8 |
|
public function getUnreadCount() |
179
|
|
|
{ |
180
|
8 |
|
return $this->unreadCount; |
181
|
|
|
} |
182
|
|
|
|
183
|
|
|
/** |
184
|
|
|
* @return int |
185
|
|
|
*/ |
186
|
8 |
|
public function getUnreadCountDisplay() |
187
|
|
|
{ |
188
|
8 |
|
return $this->unreadCountDisplay; |
189
|
|
|
} |
190
|
|
|
} |
191
|
|
|
|