Skip to content

Commit 1558cba

Browse files
author
David Nahodyl
committed
fixed invalid omit query
1 parent 7025e5b commit 1558cba

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/Database/Query/FMBaseBuilder.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -452,21 +452,15 @@ public function omit($boolean = true)
452452

453453
$count = sizeof($this->wheres);
454454
if ($count == 0) {
455-
$currentFind = collect([]);
455+
$currentFind = [];
456+
$count = 1;
456457
} else {
457458
$currentFind = $this->wheres[sizeof($this->wheres) - 1];
458459
}
459460

460-
if ($boolean = false) {
461-
// the user is removing an omit which was already set
462-
$currentFind->forget('omit');
463-
} else {
464-
// add the omit flag to the current find request
465-
// we have to set it to the word 'true'
466-
$currentFind->put('omit', 'true');
467-
}
461+
$currentFind['omit'] = $boolean ? 'true' : 'false';
468462

469-
$this->wheres[$count] = $currentFind;
463+
$this->wheres[$count -1] = $currentFind;
470464

471465
return $this;
472466
}

0 commit comments

Comments
 (0)