Failed Conditions
Push — master ( e7b6d0...f491f4 )
by Denis
03:14
created

Filter::setField()   A

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 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
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 21
    public function getField(): string
43
    {
44 21
        return $this->field;
45
    }
46
47
    /**
48
     * @param string $field
49
     * @return Filter
50
     */
51 20
    public function setField(string $field): Filter
52
    {
53 20
        $this->field = $field;
54
55 20
        return $this;
56
    }
57
58
    /**
59
     * @return string
60
     */
61 3
    public function getType(): string
62
    {
63 3
        return $this->type;
64
    }
65
66
    /**
67
     * @param string $type
68
     * @return Filter
69
     */
70 2
    public function setType(string $type): Filter
71
    {
72 2
        $this->type = $type;
73
74 2
        return $this;
75
    }
76
77
    /**
78
     * @return string
79
     */
80 3
    public function getConnector(): string
81
    {
82 3
        return $this->connector;
83
    }
84
85
    /**
86
     * @param string $connector
87
     * @return Filter
88
     */
89
    public function setConnector(string $connector): Filter
90
    {
91
        $this->connector = $connector;
92
93
        return $this;
94
    }
95
96
    /**
97
     * @return bool
98
     */
99 3
    public function isHaving(): bool
100
    {
101 3
        return $this->having;
102
    }
103
104
    /**
105
     * @param bool $having
106
     * @return Filter
107
     */
108
    public function setHaving(bool $having): Filter
109
    {
110
        $this->having = $having;
111
112
        return $this;
113
    }
114
115
    /**
116
     * @return mixed
117
     */
118 19
    public function getX()
119
    {
120 19
        return $this->x;
121
    }
122
123
    /**
124
     * @param mixed $x
125
     * @return Filter
126
     */
127 18
    public function setX($x): Filter
128
    {
129 18
        $this->x = $x;
130
131 18
        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 2
    public function setY($y): Filter
147
    {
148 2
        $this->y = $y;
149
150 2
        return $this;
151
    }
152
153
    /**
154
     * @return mixed
155
     */
156 6
    public function getExtra()
157
    {
158 6
        return $this->extra;
159
    }
160
161
    /**
162
     * @param mixed $extra
163
     * @return Filter
164
     */
165 4
    public function setExtra($extra): Filter
166
    {
167 4
        $this->extra = $extra;
168
169 4
        return $this;
170
    }
171
}