Skip to content

Commit

Permalink
added support for numberic types in wherein queries for mongodb
Browse files Browse the repository at this point in the history
  • Loading branch information
hlorofos committed Jan 22, 2018
1 parent 02db705 commit 6d57975
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/UriParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,16 @@ private function appendQueryParameterAsWhereIn($parameter, $key)
}
}

$value = explode($seperator, $parameter)[1];
$value = $value === 'null' ? null : (is_numeric($value)?(float)$value:$value);

if ($index !== null) {
$this->queryParameters[$index]['values'][] = explode($seperator, $parameter)[1];
$this->queryParameters[$index]['values'][] = $value;
} else {
$this->queryParameters[] = [
'type' => $type,
'key' => $key,
'values' => [explode($seperator, $parameter)[1]]
'values' => [$value]
];
}
}
Expand Down

0 comments on commit 6d57975

Please sign in to comment.