From 01a65c9de474e4267e10b0aa8025ab5b9da43ae3 Mon Sep 17 00:00:00 2001 From: lux Date: Sun, 21 Jan 2024 23:34:01 -0600 Subject: [PATCH] Fixed issue with ::get() response when object isn't found --- lib/Model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Model.php b/lib/Model.php index 145d2e2c..fe26174a 100644 --- a/lib/Model.php +++ b/lib/Model.php @@ -511,7 +511,7 @@ public function remove ($id = false) { public static function get ($id) { $class = get_called_class (); $q = new $class; - $res = (array) DB::single ('select * from `' . $q->table . '` where `' . $q->key . '` = ?', $id); + $res = DB::single ('select * from `' . $q->table . '` where `' . $q->key . '` = ?', $id); if (! $res) { $q->error = (DB::$error != false) ? DB::error () : 'No object by that ID.'; $q->data = array ();