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

Fixed issue where orderBy statements do not get sent to the server for queries with no operands #167

Open
wants to merge 3 commits 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
9 changes: 8 additions & 1 deletion parseQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public function __construct($class=''){
}

public function find(){
if(empty($this->_query)){
if(empty($this->_query) && count($this->_order) === 0) {

$request = $this->request(array(
'method' => 'GET',
'requestUrl' => $this->_requestUrl
Expand All @@ -37,6 +38,12 @@ public function find(){
$urlParams = array(
'where' => json_encode( $this->_query )
);

// Remove where clause if it is not required
if(empty($this->_query)) {
$urlParams = array();
}

if(!empty($this->_include)){
$urlParams['include'] = implode(',',$this->_include);
}
Expand Down