Skip to content

Commit 3a2b505

Browse files
author
Tom Kuijer
committed
Correctly set the sort order when adding an orderBy to a query
1 parent 998f158 commit 3a2b505

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Database/Query/FMBaseBuilder.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,12 @@ public function recordId($recordId)
340340

341341
public function orderBy($column, $direction = self::ASCEND): FMBaseBuilder
342342
{
343+
$direction = match($direction) {
344+
self::ASCEND, 'asc' => self::ASCEND,
345+
self::DESCEND, 'desc' => self::DESCEND,
346+
default => $direction
347+
};
348+
343349
$this->appendSortOrder($column, $direction);
344350

345351
return $this;

0 commit comments

Comments
 (0)