Skip to content

Commit f6a9c9c

Browse files
committed
$range and $offset have 0 as default value which is easier to handle then -1
1 parent 3813a53 commit f6a9c9c

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
@@ -506,7 +506,7 @@ private function buildScriptParameters($param)
506506
* @return FileMakerRelation|null Query result.
507507
* @throws Exception In case of any error, an exception arises.
508508
*/
509-
public function query($condition = null, $sort = null, $offset = -1, $range = -1, $portal = null, $script = null)
509+
public function query($condition = null, $sort = null, $offset = 0, $range = 0, $portal = null, $script = null)
510510
{
511511
try {
512512
if ($this->restAPI->login()) {
@@ -515,10 +515,10 @@ public function query($condition = null, $sort = null, $offset = -1, $range = -1
515515
if (!is_null($sort)) {
516516
$request["sort"] = $sort;
517517
}
518-
if ($offset > -1) {
518+
if ($offset > 0) {
519519
$request["offset"] = (string)$offset;
520520
}
521-
if ($range > -1) {
521+
if ($range > 0) {
522522
$request["limit"] = (string)$range;
523523
}
524524
if (!is_null($portal)) {

0 commit comments

Comments
 (0)