Skip to content

Commit 5dfe4ff

Browse files
committed
Improve solution for #435
1 parent d948946 commit 5dfe4ff

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Tqdev/PhpCrudApi/Record/OrderingInfo.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ public function getColumnOrdering(ReflectedTable $table, array $params): array
2929
$pk = $table->getPk();
3030
if ($pk) {
3131
$fields[] = [$pk->getName(), 'ASC'];
32+
} else {
33+
foreach ($table->columnNames() as $columnName) {
34+
$fields[] = [$columnName, 'ASC'];
35+
}
36+
3237
}
3338
}
3439
return $fields;

0 commit comments

Comments
 (0)