@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | /** |
55 | 55 | * @return Doctrine\ORM\Query |
56 | - */ |
|
56 | + */ |
|
57 | 57 | public function getQuery() |
58 | 58 | { |
59 | 59 | return $this->data_source->getQuery(); |
@@ -222,11 +222,11 @@ discard block |
||
222 | 222 | continue; |
223 | 223 | } |
224 | 224 | |
225 | - if ($filter->hasSplitWordsSearch() === FALSE) { |
|
226 | - $words = [$value]; |
|
227 | - } else { |
|
228 | - $words = explode(' ', $value); |
|
229 | - } |
|
225 | + if ($filter->hasSplitWordsSearch() === FALSE) { |
|
226 | + $words = [$value]; |
|
227 | + } else { |
|
228 | + $words = explode(' ', $value); |
|
229 | + } |
|
230 | 230 | |
231 | 231 | foreach ($words as $word) { |
232 | 232 | $exprs[] = $this->data_source->expr()->like($c, $this->data_source->expr()->literal("%$word%")); |
@@ -122,7 +122,7 @@ |
||
122 | 122 | $or = []; |
123 | 123 | |
124 | 124 | foreach ($condition as $column => $value) { |
125 | - if($filter->isExactSearch()){ |
|
125 | + if ($filter->isExactSearch()) { |
|
126 | 126 | $this->data_source->where("$column = %s", $value); |
127 | 127 | continue; |
128 | 128 | } |
@@ -122,7 +122,7 @@ |
||
122 | 122 | $or = []; |
123 | 123 | |
124 | 124 | foreach ($condition as $column => $value) { |
125 | - if($filter->isExactSearch()){ |
|
125 | + if ($filter->isExactSearch()) { |
|
126 | 126 | $this->data_source->where("$column = %s", $value); |
127 | 127 | continue; |
128 | 128 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $value_from = $conditions[$filter->getColumn()]['from']; |
138 | 138 | $value_to = $conditions[$filter->getColumn()]['to']; |
139 | 139 | |
140 | - if ($value_from || $value_from != '') { |
|
140 | + if ($value_from || $value_from != '') { |
|
141 | 141 | $this->data_source->where('%n >= ?', $filter->getColumn(), $value_from); |
142 | 142 | } |
143 | 143 | |
@@ -164,11 +164,11 @@ discard block |
||
164 | 164 | continue; |
165 | 165 | } |
166 | 166 | |
167 | - if ($filter->hasSplitWordsSearch() === FALSE) { |
|
168 | - $words = [$value]; |
|
169 | - } else { |
|
170 | - $words = explode(' ', $value); |
|
171 | - } |
|
167 | + if ($filter->hasSplitWordsSearch() === FALSE) { |
|
168 | + $words = [$value]; |
|
169 | + } else { |
|
170 | + $words = explode(' ', $value); |
|
171 | + } |
|
172 | 172 | |
173 | 173 | foreach ($words as $word) { |
174 | 174 | $escaped = $this->data_source->getConnection()->getDriver()->escapeLike($word, 0); |
@@ -122,7 +122,7 @@ |
||
122 | 122 | $or = []; |
123 | 123 | |
124 | 124 | foreach ($condition as $column => $value) { |
125 | - if($filter->isExactSearch()){ |
|
125 | + if ($filter->isExactSearch()) { |
|
126 | 126 | $this->data_source->where("$column = %s", $value); |
127 | 127 | continue; |
128 | 128 | } |
@@ -149,11 +149,11 @@ |
||
149 | 149 | $condition = $filter->getCondition(); |
150 | 150 | |
151 | 151 | foreach ($condition as $column => $value) { |
152 | - if ($filter instanceof FilterText && $filter->isExactSearch()) { |
|
153 | - return $row[$column] == $value; |
|
154 | - } |
|
152 | + if ($filter instanceof FilterText && $filter->isExactSearch()) { |
|
153 | + return $row[$column] == $value; |
|
154 | + } |
|
155 | 155 | |
156 | - if ($filter instanceof FilterText && $filter->hasSplitWordsSearch() === FALSE) { |
|
156 | + if ($filter instanceof FilterText && $filter->hasSplitWordsSearch() === FALSE) { |
|
157 | 157 | $words = [$value]; |
158 | 158 | } else { |
159 | 159 | $words = explode(' ', $value); |
@@ -175,17 +175,17 @@ |
||
175 | 175 | $like .= "$column = ? OR "; |
176 | 176 | $args[] = "$value"; |
177 | 177 | } else { |
178 | - if ($filter->hasSplitWordsSearch() === FALSE) { |
|
179 | - $words = [$value]; |
|
180 | - } else { |
|
181 | - $words = explode(' ', $value); |
|
182 | - } |
|
183 | - foreach ($words as $word) { |
|
184 | - $like .= "$column LIKE ? OR "; |
|
185 | - $args[] = "%$word%"; |
|
186 | - } |
|
187 | - } |
|
188 | - $like = substr($like, 0, strlen($like) - 4) . ')'; |
|
178 | + if ($filter->hasSplitWordsSearch() === FALSE) { |
|
179 | + $words = [$value]; |
|
180 | + } else { |
|
181 | + $words = explode(' ', $value); |
|
182 | + } |
|
183 | + foreach ($words as $word) { |
|
184 | + $like .= "$column LIKE ? OR "; |
|
185 | + $args[] = "%$word%"; |
|
186 | + } |
|
187 | + } |
|
188 | + $like = substr($like, 0, strlen($like) - 4) . ')'; |
|
189 | 189 | |
190 | 190 | $or[] = $like; |
191 | 191 | $big_or .= "$like OR "; |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | return $this->data_source->count( |
63 | - $this->data_source->getName() . '.' . (is_array($primary) ? reset($primary) : $primary) |
|
63 | + $this->data_source->getName().'.'.(is_array($primary) ? reset($primary) : $primary) |
|
64 | 64 | ); |
65 | 65 | } |
66 | 66 | |
@@ -171,8 +171,8 @@ discard block |
||
171 | 171 | $like = '('; |
172 | 172 | $args = []; |
173 | 173 | |
174 | - if($filter->isExactSearch()){ |
|
175 | - $like .= "$column = ? OR "; |
|
174 | + if ($filter->isExactSearch()) { |
|
175 | + $like .= "$column = ? OR "; |
|
176 | 176 | $args[] = "$value"; |
177 | 177 | } else { |
178 | 178 | if ($filter->hasSplitWordsSearch() === FALSE) { |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | $args[] = "%$word%"; |
186 | 186 | } |
187 | 187 | } |
188 | - $like = substr($like, 0, strlen($like) - 4) . ')'; |
|
188 | + $like = substr($like, 0, strlen($like) - 4).')'; |
|
189 | 189 | |
190 | 190 | $or[] = $like; |
191 | 191 | $big_or .= "$like OR "; |
@@ -223,9 +223,9 @@ discard block |
||
223 | 223 | |
224 | 224 | foreach ($values as $value) { |
225 | 225 | if ($i == $length) { |
226 | - $or .= $filter->getColumn() . ' = ?)'; |
|
226 | + $or .= $filter->getColumn().' = ?)'; |
|
227 | 227 | } else { |
228 | - $or .= $filter->getColumn() . ' = ? OR '; |
|
228 | + $or .= $filter->getColumn().' = ? OR '; |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | $i++; |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | |
236 | 236 | call_user_func_array([$this->data_source, 'where'], $values); |
237 | 237 | } else { |
238 | - $this->data_source->where($filter->getColumn() . ' = ?', reset($values)); |
|
238 | + $this->data_source->where($filter->getColumn().' = ?', reset($values)); |
|
239 | 239 | } |
240 | 240 | } |
241 | 241 |