Completed
Push — master ( 9015f5...88a8da )
by Derek Stephen
08:27
created

EntryCriteria::getNote()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Del\Expenses\Criteria;
4
5
use DateTime;
6
use Del\Common\Criteria as CommonCriteria;
7
8
9
class EntryCriteria extends CommonCriteria
0 ignored issues
show
Deprecated Code introduced by
The class Del\Common\Criteria has been deprecated with message: use Del\Common\Criteria\AbstractCriteria

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
10
{
11
    const ORDER_AMOUNT          = 'amount';
12
    const ORDER_CATEGORY        = 'category';
13
    const ORDER_DATE            = 'date';
14
    const ORDER_DESCRIPTION     = 'description';
15
    const ORDER_ID              = 'id';
16
    const ORDER_NOTE            = 'note';
17
    const ORDER_TYPE            = 'type';
18
    const ORDER_USERID          = 'userId';
19
20
    protected $id;
21
    protected $userId;
22
    protected $date;
23
    protected $dateRange;
24
    protected $amount;
25
    protected $category;
26
    protected $description;
27
    protected $note;
28
    protected $type;
29
30
    /**
31
     * @return int
32
     */
33 2
    public function getId()
34
    {
35 2
        return $this->id;
36
    }
37
38
    /**
39
     * @param $id
40
     * @return $this
41
     */
42 2
    public function setId($id)
43
    {
44 2
        $this->id = (int) $id;
45 2
        return $this;
46
    }
47
48
    /**
49
     * @return bool
50
     */
51 3
    public function hasId()
52
    {
53 3
        return $this->id != null;
54
    }
55
56
    /**
57
     * @return int
58
     */
59
    public function getUserId()
60
    {
61
        return $this->userId;
62
    }
63
64
    /**
65
     * @param $id
66
     * @return $this
67
     */
68
    public function setUserId($id)
69
    {
70
        $this->userId = (int) $id;
71
        return $this;
72
    }
73
74
    /**
75
     * @return bool
76
     */
77 3
    public function hasUserId()
78
    {
79 3
        return $this->userId != null;
80
    }
81
82
    /**
83
     * @return mixed
84
     */
85 1
    public function getDate()
86
    {
87 1
        return $this->date;
88
    }
89
90
    /**
91
     * @param mixed $date
92
     * @return EntryCriteria
93
     */
94 1
    public function setDate($date)
95
    {
96 1
        $this->date = $date;
97 1
        return $this;
98
    }
99
100
    /**
101
     * @return bool
102
     */
103 3
    public function hasDateRange()
104
    {
105 3
        return $this->dateRange != null;
106
    }
107
108
    /**
109
     * @return mixed
110
     */
111 1
    public function getDateRange()
112
    {
113 1
        return $this->dateRange;
114
    }
115
116
    /**
117
     * @param string $fromDate
118
     * @param string $toDate
119
     * @return $this
120
     */
121 1
    public function setDateRange($fromDate, $toDate)
122
    {
123 1
        $this->dateRange = [
124 1
            $fromDate, $toDate
125 1
        ];
126 1
        return $this;
127
    }
128
129
    /**
130
     * @return bool
131
     */
132 3
    public function hasDate()
133
    {
134 3
        return $this->date != null;
135
    }
136
137
    /**
138
     * @return mixed
139
     */
140
    public function getAmount()
141
    {
142
        return $this->amount;
143
    }
144
145
    /**
146
     * @param mixed $amount
147
     * @return EntryCriteria
148
     */
149
    public function setAmount($amount)
150
    {
151
        $this->amount = $amount;
152
        return $this;
153
    }
154
155
    /**
156
     * @return bool
157
     */
158 3
    public function hasAmount()
159
    {
160 3
        return $this->amount != null;
161
    }
162
163
    /**
164
     * @return mixed
165
     */
166 1
    public function getCategory()
167
    {
168 1
        return $this->category;
169
    }
170
171
    /**
172
     * @param mixed $category
173
     * @return EntryCriteria
174
     */
175 1
    public function setCategory($category)
176
    {
177 1
        $this->category = $category;
178 1
        return $this;
179
    }
180
181
    /**
182
     * @return bool
183
     */
184 3
    public function hasCategory()
185
    {
186 3
        return $this->category != null;
187
    }
188
189
    /**
190
     * @return mixed
191
     */
192 1
    public function getDescription()
193
    {
194 1
        return $this->description;
195
    }
196
197
    /**
198
     * @param mixed $description
199
     * @return EntryCriteria
200
     */
201 1
    public function setDescription($description)
202
    {
203 1
        $this->description = $description;
204 1
        return $this;
205
    }
206
207
    /**
208
     * @return bool
209
     */
210 3
    public function hasDescription()
211
    {
212 3
        return $this->description != null;
213
    }
214
215
    /**
216
     * @return mixed
217
     */
218 1
    public function getNote()
219
    {
220 1
        return $this->note;
221
    }
222
223
    /**
224
     * @param mixed $note
225
     * @return EntryCriteria
226
     */
227 1
    public function setNote($note)
228
    {
229 1
        $this->note = $note;
230 1
        return $this;
231
    }
232
233
    /**
234
     * @return bool
235
     */
236 3
    public function hasNote()
237
    {
238 3
        return $this->note != null;
239
    }
240
241
    /**
242
     * @return mixed
243
     */
244 1
    public function getType()
245
    {
246 1
        return $this->type;
247
    }
248
249
    /**
250
     * @param mixed $type
251
     * @return EntryCriteria
252
     */
253 1
    public function setType($type)
254
    {
255 1
        $this->type = $type;
256 1
        return $this;
257
    }
258
259
    /**
260
     * @return bool
261
     */
262 3
    public function hasType()
263
    {
264 3
        return $this->type != null;
265
    }
266
267
268
}