Skip to content

Commit 618e21a

Browse files
authored
Merge pull request #40 from schube/offset_range_defaulted_to_0
$range and $offset have 0 as default value which is easier to handle …
2 parents e48cfa7 + f6a9c9c commit 618e21a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

FMDataAPI.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ private function buildScriptParameters($param)
512512
* @return FileMakerRelation|null Query result.
513513
* @throws Exception In case of any error, an exception arises.
514514
*/
515-
public function query($condition = null, $sort = null, $offset = -1, $range = -1, $portal = null, $script = null)
515+
public function query($condition = null, $sort = null, $offset = 0, $range = 0, $portal = null, $script = null)
516516
{
517517
try {
518518
if ($this->restAPI->login()) {
@@ -521,10 +521,10 @@ public function query($condition = null, $sort = null, $offset = -1, $range = -1
521521
if (!is_null($sort)) {
522522
$request["sort"] = $sort;
523523
}
524-
if ($offset > -1) {
524+
if ($offset > 0) {
525525
$request["offset"] = (string)$offset;
526526
}
527-
if ($range > -1) {
527+
if ($range > 0) {
528528
$request["limit"] = (string)$range;
529529
}
530530
if (!is_null($portal)) {

0 commit comments

Comments
 (0)