Skip to content

Commit

Permalink
extend partitioned queries to the findAll() method
Browse files Browse the repository at this point in the history
  • Loading branch information
phuze committed May 24, 2019
1 parent 9add380 commit 53cbb8c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,16 @@ public function findAll($isCrossPartition = false)
$this->response = null;
$this->multipleResults = true;

$partitionValue = $this->partitionValue != null ? $this->partitionValue : null;

$limit = $this->limit != null ? "top " . (int)$this->limit : "";
$fields = !empty($this->fields) ? $this->fields : '*';
$where = $this->where != "" ? "where {$this->where}" : "";
$order = $this->order != "" ? "order by {$this->order}" : "";

$query = "SELECT {$limit} {$fields} FROM {$this->from} {$this->join} {$where} {$order}";

$this->response = $this->collection->query($query, $this->params, $isCrossPartition);
$this->response = $this->collection->query($query, $this->params, $isCrossPartition, $partitionValue);

return $this;
}
Expand Down

0 comments on commit 53cbb8c

Please sign in to comment.