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/user |
18
|
|
|
*/ |
19
|
|
|
class User extends AbstractModel |
20
|
|
|
{ |
21
|
|
|
/** |
22
|
|
|
* @var string |
23
|
|
|
*/ |
24
|
|
|
private $id; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @var string|null |
28
|
|
|
*/ |
29
|
|
|
private $team_id; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @var string |
33
|
|
|
*/ |
34
|
|
|
private $name; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @var string|null |
38
|
|
|
*/ |
39
|
|
|
private $color; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @var UserProfile|null |
43
|
|
|
*/ |
44
|
|
|
private $profile; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @var bool|null |
48
|
|
|
*/ |
49
|
|
|
private $isAdmin; |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @var bool|null |
53
|
|
|
*/ |
54
|
|
|
private $isBot; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @var bool|null |
58
|
|
|
*/ |
59
|
|
|
private $isRestricted; |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* @var bool|null |
63
|
|
|
*/ |
64
|
|
|
private $isUltraRestricted; |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @var bool|null |
68
|
|
|
*/ |
69
|
|
|
private $deleted; |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @var bool|null |
73
|
|
|
*/ |
74
|
|
|
private $hasFiles; |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @return string The ID of this member. |
78
|
|
|
*/ |
79
|
3 |
|
public function getId() |
80
|
|
|
{ |
81
|
3 |
|
return $this->id; |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @return null|string |
86
|
|
|
*/ |
87
|
|
|
public function getTeamId() |
88
|
|
|
{ |
89
|
|
|
return $this->team_id; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* @return string The (user)name of this member |
94
|
|
|
*/ |
95
|
3 |
|
public function getName() |
96
|
|
|
{ |
97
|
3 |
|
return $this->name; |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* @return string|null Hexadecimal colorcode used in some clients to display a colored username. |
102
|
|
|
*/ |
103
|
3 |
|
public function getColor() |
104
|
|
|
{ |
105
|
3 |
|
return $this->color; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @return MemberProfile The profile object for this member |
110
|
|
|
*/ |
111
|
3 |
|
public function getProfile() |
112
|
|
|
{ |
113
|
3 |
|
return $this->profile; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @return bool True if the user has been given the admin role, false otherwise. |
118
|
|
|
*/ |
119
|
3 |
|
public function isAdmin() |
120
|
|
|
{ |
121
|
3 |
|
return $this->isAdmin; |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* @return bool True if the user is a bot, false otherwise. |
126
|
|
|
*/ |
127
|
3 |
|
public function isBot() |
128
|
|
|
{ |
129
|
3 |
|
return $this->isBot; |
130
|
|
|
} |
131
|
|
|
|
132
|
|
|
/** |
133
|
|
|
* @return bool True if the user has restrictions applied, false otherwise. |
134
|
|
|
*/ |
135
|
3 |
|
public function isRestricted() |
136
|
|
|
{ |
137
|
3 |
|
return $this->isRestricted; |
138
|
|
|
} |
139
|
|
|
|
140
|
|
|
/** |
141
|
|
|
* @return bool True if the user has ultra restrictions applied, false otherwise. |
142
|
|
|
*/ |
143
|
3 |
|
public function isUltraRestricted() |
144
|
|
|
{ |
145
|
3 |
|
return $this->isUltraRestricted; |
146
|
|
|
} |
147
|
|
|
|
148
|
|
|
/** |
149
|
|
|
* @return bool True if the user has been deactivated. |
150
|
|
|
*/ |
151
|
3 |
|
public function isDeleted() |
152
|
|
|
{ |
153
|
3 |
|
return $this->deleted; |
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
/** |
157
|
|
|
* @return bool True if the user has added files to the Slack instance, false otherwise. |
158
|
|
|
*/ |
159
|
3 |
|
public function hasFiles() |
160
|
|
|
{ |
161
|
3 |
|
return $this->hasFiles; |
162
|
|
|
} |
163
|
|
|
} |
164
|
|
|
|