Completed
Branch master (6321d1)
by Gawain
10:09 queued 03:32
created

Users::getPassword()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace Bolt\Storage\Entity;
3
4
/**
5
 * Entity for User.
6
 */
7
class Users extends Entity
8
{
9
    /** @var int */
10
    protected $id;
11
    /** @var string */
12
    protected $username;
13
    /** @var string */
14
    protected $password;
15
    /** @var string */
16
    protected $email;
17
    /** @var \DateTime */
18
    protected $lastseen;
19
    /** @var string */
20
    protected $lastip;
21
    /** @var string */
22
    protected $displayname;
23
    /** @var array */
24
    protected $stack = [];
25
    /** @var bool */
26
    protected $enabled;
27
    /** @var string */
28
    protected $shadowpassword;
29
    /** @var string */
30
    protected $shadowtoken;
31
    /** @var string */
32
    protected $shadowvalidity;
33
    /** @var int */
34
    protected $failedlogins = 0;
35
    /** @var \DateTime */
36
    protected $throttleduntil;
37
    /** @var array */
38
    protected $roles = [];
39
40
    /**
41
     * @return int
42
     */
43
    public function getId()
44
    {
45
        return $this->id;
46
    }
47
48
    /**
49
     * @param int $id
50
     */
51
    public function setId($id)
52
    {
53
        $this->id = $id;
54
    }
55
56
    /**
57
     * @return string
58
     */
59
    public function getUsername()
60
    {
61
        return $this->username;
62
    }
63
64
    /**
65
     * @param string $username
66
     */
67
    public function setUsername($username)
68
    {
69
        $this->username = $username;
70
    }
71
72
    /**
73
     * @return string
74
     */
75
    public function getPassword()
76
    {
77
        return $this->password;
78
    }
79
80
    /**
81
     * @param string $password
82
     */
83
    public function setPassword($password)
84
    {
85
        $this->password = $password;
86
    }
87
88
    /**
89
     * @return string
90
     */
91
    public function getEmail()
92
    {
93
        return $this->email;
94
    }
95
96
    /**
97
     * @param string $email
98
     */
99
    public function setEmail($email)
100
    {
101
        $this->email = $email;
102
    }
103
104
    /**
105
     * @return \DateTime
106
     */
107
    public function getLastseen()
108
    {
109
        return $this->lastseen;
110
    }
111
112
    /**
113
     * @param \DateTime $lastseen
114
     */
115
    public function setLastseen($lastseen)
116
    {
117
        $this->lastseen = $lastseen;
118
    }
119
120
    /**
121
     * @return string
122
     */
123
    public function getLastip()
124
    {
125
        return $this->lastip;
126
    }
127
128
    /**
129
     * @param string $lastip
130
     */
131
    public function setLastip($lastip)
132
    {
133
        $this->lastip = $lastip;
134
    }
135
136
    /**
137
     * @return string
138
     */
139
    public function getDisplayname()
140
    {
141
        return $this->displayname;
142
    }
143
144
    /**
145
     * @param string $displayname
146
     */
147
    public function setDisplayname($displayname)
148
    {
149
        $this->displayname = $displayname;
150
    }
151
152
    /**
153
     * @return array
154
     */
155
    public function getStack()
156
    {
157
        return $this->stack;
158
    }
159
160
    /**
161
     * @param array $stack
162
     */
163
    public function setStack($stack)
164
    {
165
        $this->stack = $stack;
166
    }
167
168
    /**
169
     * @return boolean
170
     */
171
    public function isEnabled()
172
    {
173
        return (bool) $this->enabled;
174
    }
175
176
    /**
177
     * Getter for enabled flag
178
     *
179
     * @return boolean
180
     */
181
    public function getEnabled()
182
    {
183
        return (bool) $this->enabled;
184
    }
185
186
    /**
187
     * @param boolean $enabled
188
     */
189
    public function setEnabled($enabled)
190
    {
191
        $this->enabled = (int) $enabled;
192
    }
193
194
    /**
195
     * @return string
196
     */
197
    public function getShadowpassword()
198
    {
199
        return $this->shadowpassword;
200
    }
201
202
    /**
203
     * @param string $shadowpassword
204
     */
205
    public function setShadowpassword($shadowpassword)
206
    {
207
        $this->shadowpassword = $shadowpassword;
208
    }
209
210
    /**
211
     * @return string
212
     */
213
    public function getShadowtoken()
214
    {
215
        return $this->shadowtoken;
216
    }
217
218
    /**
219
     * @param string $shadowtoken
220
     */
221
    public function setShadowtoken($shadowtoken)
222
    {
223
        $this->shadowtoken = $shadowtoken;
224
    }
225
226
    /**
227
     * @return string
228
     */
229
    public function getShadowvalidity()
230
    {
231
        return $this->shadowvalidity;
232
    }
233
234
    /**
235
     * @param string $shadowvalidity
236
     */
237
    public function setShadowvalidity($shadowvalidity)
238
    {
239
        $this->shadowvalidity = $shadowvalidity;
240
    }
241
242
    /**
243
     * @return int
244
     */
245
    public function getFailedlogins()
246
    {
247
        return $this->failedlogins;
248
    }
249
250
    /**
251
     * @param int $failedlogins
252
     */
253
    public function setFailedlogins($failedlogins)
254
    {
255
        $this->failedlogins = $failedlogins;
256
    }
257
258
    /**
259
     * @return \DateTime
260
     */
261
    public function getThrottleduntil()
262
    {
263
        return $this->throttleduntil;
264
    }
265
266
    /**
267
     * @param \DateTime $throttleduntil
268
     */
269
    public function setThrottleduntil($throttleduntil)
270
    {
271
        $this->throttleduntil = $throttleduntil;
272
    }
273
274
    /**
275
     * @return array
276
     */
277
    public function getRoles()
278
    {
279
        return $this->roles;
280
    }
281
282
    /**
283
     * @param array $roles
284
     */
285
    public function setRoles(array $roles)
286
    {
287
        $this->roles = array_values(array_unique($roles));
288
    }
289
}
290