From 7793904c0637987da80bc30b3487703248961c96 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Mon, 16 Feb 2026 15:04:38 +0100 Subject: [PATCH] fix: pass optional return value to database Model->set() --- src/Database/Model.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Database/Model.php b/src/Database/Model.php index 3ff76fe..7f8bed6 100644 --- a/src/Database/Model.php +++ b/src/Database/Model.php @@ -97,9 +97,10 @@ * * @param string $key Target column to update * @param mixed $value New value of target column + * @param return $return (optional) Return this instead of $value when set * @return mixed The value that was sent to $value */ - public function set(string $key, mixed $value): mixed { + public function set(string $key, mixed $value, mixed $return = null): mixed { $this->_row[$key] = $value; $this->db @@ -107,6 +108,6 @@ ->where($this->where) ->update([$key => $value]); - return $value; + return $return ?? $value; } }