Completed
Push — master ( 4bad87...d6e1be )
by Derek Stephen
07:20
created

UserCriteria::setId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Del\Criteria;
4
5
use Del\Common\Criteria as CommonCriteria;
6
7
8
class UserCriteria extends CommonCriteria
9
{
10
    const ORDER_ID        = 'id';
11
    const ORDER_EMAIL        = 'email';
12
    const ORDER_STATE        = 'state';
13
    const ORDER_REG_DATE       = 'registrationDate';
14
    const ORDER_LAST_LOGIN_DATE            = 'lastLoginDate';
15
16
    protected $id;
17
    protected $email;
18
    protected $state;
19
    protected $registrationDate;
20
    protected $lastLoginDate;
21
22
    /**
23
     * @return int
24
     */
25
    public function getId()
26
    {
27
        return $this->id;
28
    }
29
30
    /**
31
     * @param $id
32
     * @return $this
33
     */
34
    public function setId($id)
35
    {
36
        $this->id = (int) $id;
37
        return $this;
38
    }
39
40
    /**
41
     * @return bool
42
     */
43
    public function hasId()
44
    {
45
        return $this->id != null;
46
    }
47
48
    /**
49
     * @return mixed
50
     */
51
    public function getEmail()
52
    {
53
        return $this->email;
54
    }
55
56
    /**
57
     * @param mixed $email
58
     * @return UserCriteria
59
     */
60
    public function setEmail($email)
61
    {
62
        $this->email = $email;
63
        return $this;
64
    }
65
66
    /**
67
     * @return bool
68
     */
69
    public function hasEmail()
70
    {
71
        return $this->email != null;
72
    }
73
74
    /**
75
     * @return mixed
76
     */
77
    public function getState()
78
    {
79
        return $this->state;
80
    }
81
82
    /**
83
     * @param mixed $state
84
     * @return UserCriteria
85
     */
86
    public function setState($state)
87
    {
88
        $this->state = $state;
89
        return $this;
90
    }
91
92
    /**
93
     * @return bool
94
     */
95
    public function hasState()
96
    {
97
        return $this->state != null;
98
    }
99
100
    /**
101
     * @return mixed
102
     */
103
    public function getRegistrationDate()
104
    {
105
        return $this->registrationDate;
106
    }
107
108
    /**
109
     * @param mixed $registrationDate
110
     * @return UserCriteria
111
     */
112
    public function setRegistrationDate($registrationDate)
113
    {
114
        $this->registrationDate = $registrationDate;
115
        return $this;
116
    }
117
118
    /**
119
     * @return bool
120
     */
121
    public function hasRegistrationDate()
122
    {
123
        return $this->registrationDate != null;
124
    }
125
126
    /**
127
     * @return mixed
128
     */
129
    public function getLastLoginDate()
130
    {
131
        return $this->lastLoginDate;
132
    }
133
134
    /**
135
     * @param mixed $lastLoginDate
136
     * @return UserCriteria
137
     */
138
    public function setLastLoginDate($lastLoginDate)
139
    {
140
        $this->lastLoginDate = $lastLoginDate;
141
        return $this;
142
    }
143
144
    /**
145
     * @return bool
146
     */
147
    public function hasLastLoginDate()
148
    {
149
        return $this->lastLoginDate != null;
150
    }
151
152
153
}