From a93d743e8c0e6e7f401f502417fee4da538a47cb Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 19 Sep 2019 23:27:53 +0200 Subject: [PATCH] DbObjectWithSettings: also call setter if just... ...a setter and no getter exists --- library/Director/Data/Db/DbObjectWithSettings.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/Director/Data/Db/DbObjectWithSettings.php b/library/Director/Data/Db/DbObjectWithSettings.php index 88702be0..4f6b1392 100644 --- a/library/Director/Data/Db/DbObjectWithSettings.php +++ b/library/Director/Data/Db/DbObjectWithSettings.php @@ -19,9 +19,11 @@ abstract class DbObjectWithSettings extends DbObject { if ($this->hasProperty($key)) { return parent::set($key, $value); + } elseif ($this->hasSetterForProperty($key)) { // Hint: hasProperty checks only for Getters + return parent::set($key, $value); } - if (! array_key_exists($key, $this->settings) || $value !== $this->settings[$key]) { + if (! \array_key_exists($key, $this->settings) || $value !== $this->settings[$key]) { $this->hasBeenModified = true; }