[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
No known key found for this signature in database
GPG Key ID: 7D0C7EAFC9D835A0

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;
}