Skip to content
This repository has been archived by the owner on Feb 25, 2018. It is now read-only.

Added whereBetweenOrEqualTo to parseQuery #123

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions parseQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,18 @@ public function whereLessThanOrEqualTo($key,$value){

}

public function whereBetweenOrEqualTo($key, $startValue, $endValue){
if(isset($key) && isset($startValue) && isset($endValue)){
$this->_query[$key] = array(
'$gte' => $startValue,
'$lte' => $endValue
);
}
else{
$this->throwError('the $key, $startValue and $endValue parameters must be set when setting a "where" query method');
}
}

public function whereAll($key,$value){
if(isset($key) && isset($value)){
if(is_array($value)){
Expand Down