diff --git a/src/BaseActiveRecordTrait.php b/src/BaseActiveRecordTrait.php index 966e6e429..ad4166c89 100644 --- a/src/BaseActiveRecordTrait.php +++ b/src/BaseActiveRecordTrait.php @@ -200,7 +200,10 @@ public function __set(string $name, mixed $value): void $this->resetDependentRelations($name); } $this->attributes[$name] = $value; - } elseif (method_exists($this, 'get' . ucfirst($name))) { + return; + } + + if (method_exists($this, 'get' . ucfirst($name))) { throw new InvalidCallException('Setting read-only property: ' . static::class . '::' . $name); } }