Passed
Push — master ( 64ab61...b96172 )
by Gabor
09:36
created

UserEntity::setPassword()   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
     * Gets the value of the entity identifier.
43
     *
44
     * @return int
45
     */
46 1
    public function getKeyData()
47
    {
48 1
        return $this->userId;
49
    }
50
51
    /**
52
     * @param int $userId
53
     *
54
     * @return UserEntity
55
     */
56 7
    public function setUserId($userId)
57
    {
58 7
        $this->userId = $userId;
59
60 7
        return $this;
61
    }
62
63
    /**
64
     * @return int
65
     */
66 3
    public function getUserId()
67
    {
68 3
        return $this->userId;
69
    }
70
71
    /**
72
     * @param string $userName
73
     *
74
     * @return UserEntity
75
     */
76 4
    public function setUserName($userName)
77
    {
78 4
        $this->userName = $userName;
79
80 4
        return $this;
81
    }
82
83
    /**
84
     * @return string
85
     */
86 1
    public function getUserName()
87
    {
88 1
        return $this->userName;
89
    }
90
91
    /**
92
     * @param string $email
93
     *
94
     * @return UserEntity
95
     */
96 4
    public function setEmail($email)
97
    {
98 4
        $this->email = $email;
99
100 4
        return $this;
101
    }
102
103
    /**
104
     * @return string
105
     */
106 1
    public function getEmail()
107
    {
108 1
        return $this->email;
109
    }
110
111
    /**
112
     * @param string $password
113
     *
114
     * @return UserEntity
115
     */
116 4
    public function setPassword($password)
117
    {
118 4
        $this->password = $password;
119
120 4
        return $this;
121
    }
122
123
    /**
124
     * @return string
125
     */
126 3
    public function getPassword()
127
    {
128 3
        return $this->password;
129
    }
130
131
    /**
132
     * @param string $hash
133
     *
134
     * @return UserEntity
135
     */
136 4
    public function setHash($hash)
137
    {
138 4
        $this->hash = $hash;
139
140 4
        return $this;
141
    }
142
143
    /**
144
     * @return string
145
     */
146 1
    public function getHash()
147
    {
148 1
        return $this->hash;
149
    }
150
151
    /**
152
     * @param bool $state
153
     *
154
     * @return UserEntity
155
     */
156 8
    public function setActive($state)
157
    {
158 8
        $this->isActive = (bool) $state;
159
160 8
        return $this;
161
    }
162
163
    /**
164
     * @return bool
165
     */
166 3
    public function getActive()
167
    {
168 3
        return $this->isActive;
169
    }
170
171
    /**
172
     * @param bool $state
173
     *
174
     * @return UserEntity
175
     */
176 8
    public function setEnabled($state)
177
    {
178 8
        $this->isEnabled = (bool) $state;
179
180 8
        return $this;
181
    }
182
183
    /**
184
     * @return bool
185
     */
186 5
    public function getEnabled()
187
    {
188 5
        return $this->isEnabled;
189
    }
190
191
    /**
192
     * @param DateTime $dateCreated
193
     *
194
     * @return UserEntity
195
     */
196 4
    public function setDateCreated(DateTime $dateCreated)
197
    {
198 4
        $this->dateCreated = $dateCreated;
199
200 4
        return $this;
201
    }
202
203
    /**
204
     * @return DateTime
205
     */
206 3
    public function getDateCreated()
207
    {
208 3
        return $this->dateCreated;
209
    }
210
211
    /**
212
     * @param DateTime $dateModified
213
     *
214
     * @return UserEntity
215
     */
216 4
    public function setDateModified(DateTime $dateModified)
217
    {
218 4
        $this->dateModified = $dateModified;
219
220 4
        return $this;
221
    }
222
223
    /**
224
     * @return DateTime
225
     */
226 1
    public function getDateModified()
227
    {
228 1
        return $this->dateModified;
229
    }
230
}
231