From 20e07c9140cb593db04367bc4d8db3197ccea63a Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Thu, 31 Mar 2022 03:24:24 +0100 Subject: [PATCH] [CORE][DB] Make DB::dql return an object rather than an array if limit 1 is specified --- src/Core/DB.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Core/DB.php b/src/Core/DB.php index efd01062ef..7a6ac70670 100644 --- a/src/Core/DB.php +++ b/src/Core/DB.php @@ -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; }