Skip to content

Commit

Permalink
support different (!=) in query (#33)
Browse files Browse the repository at this point in the history
support different (!=) in query
  • Loading branch information
kaioken authored Oct 25, 2019
2 parents 5fc7e9a + 9e232bf commit 1140f89
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/QueryParserCustomFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class QueryParserCustomFields extends QueryParser
':' => '=',
'>' => '>=',
'<' => '<=',
'~' => '!=',
];

/**
Expand Down Expand Up @@ -620,7 +621,7 @@ public function parseSearchParameters(string $unparsed): array
$fieldChain = explode(';', $fieldChain);

foreach ($fieldChain as $field) {
$splitField = preg_split('#(:|>|<)#', $field, -1, PREG_SPLIT_DELIM_CAPTURE);
$splitField = preg_split('#(:|>|<|~)#', $field, -1, PREG_SPLIT_DELIM_CAPTURE);

if (count($splitField) > 3) {
$splitField[2] = implode('', array_splice($splitField, 2));
Expand Down

0 comments on commit 1140f89

Please sign in to comment.