@@ -164,11 +164,11 @@ |
||
| 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); |
@@ -159,7 +159,7 @@ |
||
| 159 | 159 | |
| 160 | 160 | foreach ($condition as $column => $value) { |
| 161 | 161 | |
| 162 | - if($filter->isExactSearch()){ |
|
| 162 | + if ($filter->isExactSearch()) { |
|
| 163 | 163 | $this->data_source->where("$column = %s", $value); |
| 164 | 164 | continue; |
| 165 | 165 | } |
@@ -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%")); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | return $column; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - return current($this->data_source->getRootAliases()) . '.' . $column; |
|
| 69 | + return current($this->data_source->getRootAliases()).'.'.$column; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | $words = explode(' ', $value); |
| 218 | 218 | $c = $this->checkAliases($column); |
| 219 | 219 | |
| 220 | - if($filter->isExactSearch()){ |
|
| 220 | + if ($filter->isExactSearch()) { |
|
| 221 | 221 | $exprs[] = $this->data_source->expr()->eq($c, $this->data_source->expr()->eq($value)); |
| 222 | 222 | continue; |
| 223 | 223 | } |
@@ -175,11 +175,11 @@ |
||
| 175 | 175 | $like .= "$column = ? "; |
| 176 | 176 | $args[] = "$value"; |
| 177 | 177 | } else { |
| 178 | - if ($filter->hasSplitWordsSearch() === FALSE) { |
|
| 179 | - $words = [$value]; |
|
| 180 | - } else { |
|
| 181 | - $words = explode(' ', $value); |
|
| 182 | - } |
|
| 178 | + if ($filter->hasSplitWordsSearch() === FALSE) { |
|
| 179 | + $words = [$value]; |
|
| 180 | + } else { |
|
| 181 | + $words = explode(' ', $value); |
|
| 182 | + } |
|
| 183 | 183 | foreach ($words as $word) { |
| 184 | 184 | $like .= "$column LIKE ? OR "; |
| 185 | 185 | $args[] = "%$word%"; |
@@ -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 = ? "; |
|
| 174 | + if ($filter->isExactSearch()) { |
|
| 175 | + $like .= "$column = ? "; |
|
| 176 | 176 | $args[] = "$value"; |
| 177 | 177 | } else { |
| 178 | 178 | if ($filter->hasSplitWordsSearch() === FALSE) { |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | $like .= "$column LIKE ? OR "; |
| 185 | 185 | $args[] = "%$word%"; |
| 186 | 186 | } |
| 187 | - $like = substr($like, 0, strlen($like) - 4) . ')'; |
|
| 187 | + $like = substr($like, 0, strlen($like) - 4).')'; |
|
| 188 | 188 | } |
| 189 | 189 | $or[] = $like; |
| 190 | 190 | $big_or .= "$like OR "; |
@@ -222,9 +222,9 @@ discard block |
||
| 222 | 222 | |
| 223 | 223 | foreach ($values as $value) { |
| 224 | 224 | if ($i == $length) { |
| 225 | - $or .= $filter->getColumn() . ' = ?)'; |
|
| 225 | + $or .= $filter->getColumn().' = ?)'; |
|
| 226 | 226 | } else { |
| 227 | - $or .= $filter->getColumn() . ' = ? OR '; |
|
| 227 | + $or .= $filter->getColumn().' = ? OR '; |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | $i++; |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | |
| 235 | 235 | call_user_func_array([$this->data_source, 'where'], $values); |
| 236 | 236 | } else { |
| 237 | - $this->data_source->where($filter->getColumn() . ' = ?', reset($values)); |
|
| 237 | + $this->data_source->where($filter->getColumn().' = ?', reset($values)); |
|
| 238 | 238 | } |
| 239 | 239 | } |
| 240 | 240 | |
@@ -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 | } |