[CORE][DB] Make DB::dql return an object rather than an array if limit 1 is specified

This commit is contained in:
Hugo Sales 2022-03-31 03:24:24 +01:00
parent 4e2f6545ec
commit 20e07c9140
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
1 changed files with 2 additions and 0 deletions

View File

@ -162,6 +162,8 @@ class DB
fn ($p) => (fn ($o) => $o instanceof $aliases[$p]),
),
);
} else if (($options['limit'] ?? null) === 1) {
return $results[0] ?? null;
} else {
return $results;
}