@@ -140,9 +140,9 @@ discard block |
||
| 140 | 140 | $case = true; |
| 141 | 141 | } |
| 142 | 142 | if($case) |
| 143 | - { |
|
| 143 | + { |
|
| 144 | 144 | if(class_exists('MongoRegex')) |
| 145 | - { |
|
| 145 | + { |
|
| 146 | 146 | return array($field=>array('$regex'=>new \MongoRegex('/'.$this->var2.'/i'))); |
| 147 | 147 | } |
| 148 | 148 | else |
@@ -236,15 +236,15 @@ discard block |
||
| 236 | 236 | { |
| 237 | 237 | case '=': |
| 238 | 238 | return array($this->var1=>$this->var2); |
| 239 | - case 'substringof': |
|
| 240 | - if(class_exists('MongoRegex')) |
|
| 241 | - { |
|
| 242 | - return array($this->var1=>array('$regex'=>new \MongoRegex('/'.$this->var2.'/i'))); |
|
| 243 | - } |
|
| 244 | - else |
|
| 245 | - { |
|
| 239 | + case 'substringof': |
|
| 240 | + if(class_exists('MongoRegex')) |
|
| 241 | + { |
|
| 242 | + return array($this->var1=>array('$regex'=>new \MongoRegex('/'.$this->var2.'/i'))); |
|
| 243 | + } |
|
| 244 | + else |
|
| 245 | + { |
|
| 246 | 246 | return array($this->var1=>array('$regex'=>new \MongoDB\BSON\Regex($this->var2, 'i'))); |
| 247 | - } |
|
| 247 | + } |
|
| 248 | 248 | case 'indexof': |
| 249 | 249 | return $this->getMongoIndexOfOperator(); |
| 250 | 250 | default: |
@@ -265,18 +265,18 @@ |
||
| 265 | 265 | } |
| 266 | 266 | switch($this->op) |
| 267 | 267 | { |
| 268 | - case '!=': |
|
| 269 | - return $value != $this->var2; |
|
| 270 | - case '=': |
|
| 271 | - return $value == $this->var2; |
|
| 272 | - case '<': |
|
| 273 | - return $value < $this->var2; |
|
| 274 | - case '<=': |
|
| 275 | - return $value <= $this->var2; |
|
| 276 | - case '>': |
|
| 277 | - return $value > $this->var2; |
|
| 278 | - case '>=': |
|
| 279 | - return $value >= $this->var2; |
|
| 268 | + case '!=': |
|
| 269 | + return $value != $this->var2; |
|
| 270 | + case '=': |
|
| 271 | + return $value == $this->var2; |
|
| 272 | + case '<': |
|
| 273 | + return $value < $this->var2; |
|
| 274 | + case '<=': |
|
| 275 | + return $value <= $this->var2; |
|
| 276 | + case '>': |
|
| 277 | + return $value > $this->var2; |
|
| 278 | + case '>=': |
|
| 279 | + return $value >= $this->var2; |
|
| 280 | 280 | } |
| 281 | 281 | } |
| 282 | 282 | } |