Passed
Push — master ( 4b954d...b01812 )
by Gabor
03:38
created

UserEntity::setHash()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * WebHemi.
4
 *
5
 * PHP version 5.6
6
 *
7
 * @copyright 2012 - 2016 Gixx-web (http://www.gixx-web.com)
8
 * @license   https://opensource.org/licenses/MIT The MIT License (MIT)
9
 *
10
 * @link      http://www.gixx-web.com
11
 */
12
namespace WebHemi\Data\Entity\User;
13
14
use DateTime;
15
use WebHemi\Data\Entity\DataEntityInterface;
16
17
/**
18
 * Class UserEntity.
19
 */
20
class UserEntity implements DataEntityInterface
21
{
22
    /** @var int */
23
    private $userId;
24
    /** @var string */
25
    private $userName;
26
    /** @var string */
27
    private $email;
28
    /** @var string */
29
    private $password;
30
    /** @var string */
31
    private $hash;
32
    /** @var bool */
33
    private $isActive;
34
    /** @var bool */
35
    private $isEnabled;
36
    /** @var DateTime */
37
    private $dateCreated;
38
    /** @var DateTime */
39
    private $dateModified;
40
41
    /**
42
     * Sets the value of the entity identifier.
43
     *
44
     * @param int $entityId
45
     * @return UserEntity
46
     */
47 2
    public function setKeyData($entityId)
48
    {
49 2
        $this->userId = $entityId;
50
51 2
        return $this;
52
    }
53
54
    /**
55
     * Gets the value of the entity identifier.
56
     *
57
     * @return int
58
     */
59 4
    public function getKeyData()
60
    {
61 4
        return $this->userId;
62
    }
63
64
    /**
65
     * @param int $userId
66
     *
67
     * @return UserEntity
68
     */
69 9
    public function setUserId($userId)
70
    {
71 9
        $this->userId = $userId;
72
73 9
        return $this;
74
    }
75
76
    /**
77
     * @return int
78
     */
79 4
    public function getUserId()
80
    {
81 4
        return $this->userId;
82
    }
83
84
    /**
85
     * @param string $userName
86
     *
87
     * @return UserEntity
88
     */
89 8
    public function setUserName($userName)
90
    {
91 8
        $this->userName = $userName;
92
93 8
        return $this;
94
    }
95
96
    /**
97
     * @return string
98
     */
99 6
    public function getUserName()
100
    {
101 6
        return $this->userName;
102
    }
103
104
    /**
105
     * @param string $email
106
     *
107
     * @return UserEntity
108
     */
109 6
    public function setEmail($email)
110
    {
111 6
        $this->email = $email;
112
113 6
        return $this;
114
    }
115
116
    /**
117
     * @return string
118
     */
119 4
    public function getEmail()
120
    {
121 4
        return $this->email;
122
    }
123
124
    /**
125
     * @param string $password
126
     *
127
     * @return UserEntity
128
     */
129 6
    public function setPassword($password)
130
    {
131 6
        $this->password = $password;
132
133 6
        return $this;
134
    }
135
136
    /**
137
     * @return string
138
     */
139 5
    public function getPassword()
140
    {
141 5
        return $this->password;
142
    }
143
144
    /**
145
     * @param string $hash
146
     *
147
     * @return UserEntity
148
     */
149 6
    public function setHash($hash)
150
    {
151 6
        $this->hash = $hash;
152
153 6
        return $this;
154
    }
155
156
    /**
157
     * @return string
158
     */
159 4
    public function getHash()
160
    {
161 4
        return $this->hash;
162
    }
163
164
    /**
165
     * @param bool $state
166
     *
167
     * @return UserEntity
168
     */
169 10
    public function setActive($state)
170
    {
171 10
        $this->isActive = (bool) $state;
172
173 10
        return $this;
174
    }
175
176
    /**
177
     * @return bool
178
     */
179 6
    public function getActive()
180
    {
181 6
        return $this->isActive;
182
    }
183
184
    /**
185
     * @param bool $state
186
     *
187
     * @return UserEntity
188
     */
189 10
    public function setEnabled($state)
190
    {
191 10
        $this->isEnabled = (bool) $state;
192
193 10
        return $this;
194
    }
195
196
    /**
197
     * @return bool
198
     */
199 7
    public function getEnabled()
200
    {
201 7
        return $this->isEnabled;
202
    }
203
204
    /**
205
     * @param DateTime $dateCreated
206
     *
207
     * @return UserEntity
208
     */
209 6
    public function setDateCreated(DateTime $dateCreated)
210
    {
211 6
        $this->dateCreated = $dateCreated;
212
213 6
        return $this;
214
    }
215
216
    /**
217
     * @return DateTime
218
     */
219 5
    public function getDateCreated()
220
    {
221 5
        return $this->dateCreated;
222
    }
223
224
    /**
225
     * @param DateTime $dateModified
226
     *
227
     * @return UserEntity
228
     */
229 6
    public function setDateModified(DateTime $dateModified)
230
    {
231 6
        $this->dateModified = $dateModified;
232
233 6
        return $this;
234
    }
235
236
    /**
237
     * @return DateTime
238
     */
239 4
    public function getDateModified()
240
    {
241 4
        return $this->dateModified;
242
    }
243
}
244