Skip to content

Commit cc1d67a

Browse files
author
hexus
committed
filtering using whereIn added as OPERATOR_SET_CONTAINS
1 parent 6414bab commit cc1d67a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: src/Processor/FilterProcessor.php

+10
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ public function process($src, OperationInterface $operation)
3232
$operator = FilterOperation::OPERATOR_LIKE;
3333
$value = '%' . $value . '%';
3434
break;
35+
case FilterOperation::OPERATOR_SET_CONTAINS:
36+
$values = is_array($value)
37+
? $value
38+
: array_map(function($value){
39+
return trim($value);
40+
}, preg_split('/[\n\t\,\|\s]+/', trim($value))
41+
);
42+
43+
$src->whereIn($field, $values);
44+
return $src;
3545
}
3646
$src->where($field, $operator, $value);
3747
return $src;

0 commit comments

Comments
 (0)