Filter::setHaving()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php declare(strict_types=1);
2
3
namespace Artprima\QueryFilterBundle\Query;
4
5
/**
6
 * Class Filter
7
 *
8
 * @author Denis Voytyuk <[email protected]>
9
 *
10
 * @package Artprima\QueryFilterBundle\Query
11
 */
12
class Filter
13
{
14
    /**
15
     * @var string
16
     */
17
    private $field;
18
19
    /**
20
     * @var string
21
     */
22
    private $type;
23
24
    /**
25
     * @var string
26
     */
27
    private $connector = 'and';
28
29
    /**
30
     * @var bool
31
     */
32
    private $having = false;
33
34
    private $x;
35
    private $y;
36
37
    private $extra;
38
39
    /**
40
     * @return string
41
     */
42 27
    public function getField(): string
43
    {
44 27
        return $this->field;
45
    }
46
47
    /**
48
     * @param string $field
49
     * @return Filter
50
     */
51 21
    public function setField(string $field): Filter
52
    {
53 21
        $this->field = $field;
54
55 21
        return $this;
56
    }
57
58
    /**
59
     * @return string
60
     */
61 6
    public function getType(): string
62
    {
63 6
        return $this->type;
64
    }
65
66
    /**
67
     * @param string $type
68
     * @return Filter
69
     */
70 3
    public function setType(string $type): Filter
71
    {
72 3
        $this->type = $type;
73
74 3
        return $this;
75
    }
76
77
    /**
78
     * @return string
79
     */
80 6
    public function getConnector(): string
81
    {
82 6
        return $this->connector;
83
    }
84
85
    /**
86
     * @param string $connector
87
     * @return Filter
88
     */
89 3
    public function setConnector(string $connector): Filter
90
    {
91 3
        $this->connector = $connector;
92
93 3
        return $this;
94
    }
95
96
    /**
97
     * @return bool
98
     */
99 6
    public function isHaving(): bool
100
    {
101 6
        return $this->having;
102
    }
103
104
    /**
105
     * @param bool $having
106
     * @return Filter
107
     */
108 3
    public function setHaving(bool $having): Filter
109
    {
110 3
        $this->having = $having;
111
112 3
        return $this;
113
    }
114
115
    /**
116
     * @return mixed
117
     */
118 22
    public function getX()
119
    {
120 22
        return $this->x;
121
    }
122
123
    /**
124
     * @param mixed $x
125
     * @return Filter
126
     */
127 19
    public function setX($x): Filter
128
    {
129 19
        $this->x = $x;
130
131 19
        return $this;
132
    }
133
134
    /**
135
     * @return mixed
136
     */
137 2
    public function getY()
138
    {
139 2
        return $this->y;
140
    }
141
142
    /**
143
     * @param mixed $y
144
     * @return Filter
145
     */
146 5
    public function setY($y): Filter
147
    {
148 5
        $this->y = $y;
149
150 5
        return $this;
151
    }
152
153
    /**
154
     * @return mixed
155
     */
156 8
    public function getExtra()
157
    {
158 8
        return $this->extra;
159
    }
160
161
    /**
162
     * @param mixed $extra
163
     * @return Filter
164
     */
165 5
    public function setExtra($extra): Filter
166
    {
167 5
        $this->extra = $extra;
168
169 5
        return $this;
170
    }
171
}