This commit is contained in:
2021-11-11 03:39:22 +08:00
parent 368a102409
commit d7f982b44f
+2 -5
View File
@@ -129,9 +129,7 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
{ {
$method = di(Setter::class)->getSetter(static::class, $name); $method = di(Setter::class)->getSetter(static::class, $name);
if (!empty($method)) { if (!empty($method)) {
var_dump($value);
$value = $this->{$method}($value); $value = $this->{$method}($value);
var_dump($value);
} }
return $value; return $value;
} }
@@ -514,10 +512,9 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
if (empty($param)) { if (empty($param)) {
return $this; return $this;
} }
foreach ($this->_attributes as $key => $attribute) { foreach ($param as $key => $attribute) {
$this->_attributes[$key] = $this->_setter($key, $attribute); $this->setAttribute($key, $attribute);
} }
var_dump($this->_attributes);
return $this; return $this;
} }