Skip to content

Commit

Permalink
filtering using whereIn added as OPERATOR_SET_CONTAINS
Browse files Browse the repository at this point in the history
  • Loading branch information
hexus committed Jul 17, 2020
1 parent 6414bab commit cc1d67a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Processor/FilterProcessor.php
Expand Up @@ -32,6 +32,16 @@ public function process($src, OperationInterface $operation)
$operator = FilterOperation::OPERATOR_LIKE;
$value = '%' . $value . '%';
break;
case FilterOperation::OPERATOR_SET_CONTAINS:
$values = is_array($value)
? $value
: array_map(function($value){
return trim($value);
}, preg_split('/[\n\t\,\|\s]+/', trim($value))
);

$src->whereIn($field, $values);
return $src;
}
$src->where($field, $operator, $value);
return $src;
Expand Down

0 comments on commit cc1d67a

Please sign in to comment.