|
@@ 131-139 (lines=9) @@
|
| 128 |
|
}); |
| 129 |
|
|
| 130 |
|
foreach($andPredicates as $predicate) { |
| 131 |
|
if (is_array($predicate[1])) { |
| 132 |
|
$documents = $this->filter($documents, $predicate[1]); |
| 133 |
|
} else { |
| 134 |
|
list($type, $field, $operator, $value) = $predicate; |
| 135 |
|
|
| 136 |
|
$documents = array_values(array_filter($documents, function ($doc) use ($field, $operator, $value) { |
| 137 |
|
return $this->matchDocument($doc, $field, $operator, $value); |
| 138 |
|
})); |
| 139 |
|
} |
| 140 |
|
|
| 141 |
|
$result = $documents; |
| 142 |
|
} |
|
@@ 145-153 (lines=9) @@
|
| 142 |
|
} |
| 143 |
|
|
| 144 |
|
foreach($orPredicates as $predicate) { |
| 145 |
|
if (is_array($predicate[1])) { |
| 146 |
|
$documents = $this->filter($originalDocs, $predicate[1]); |
| 147 |
|
} else { |
| 148 |
|
list($type, $field, $operator, $value) = $predicate; |
| 149 |
|
|
| 150 |
|
$documents = array_values(array_filter($originalDocs, function ($doc) use ($field, $operator, $value) { |
| 151 |
|
return $this->matchDocument($doc, $field, $operator, $value); |
| 152 |
|
})); |
| 153 |
|
} |
| 154 |
|
|
| 155 |
|
$result = array_unique(array_merge($result, $documents), SORT_REGULAR); |
| 156 |
|
} |