This commit is contained in:
as2252258@163.com
2021-05-02 04:56:05 +08:00
parent e6e2449fe6
commit 7473193da6
+3 -2
View File
@@ -968,7 +968,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
*/ */
public function offsetExists(mixed $offset): bool public function offsetExists(mixed $offset): bool
{ {
return isset($this->_attributes[$offset]); return isset($this->_attributes[$offset]) || isset($this->_oldAttributes[$offset]);
} }
/** /**
@@ -997,7 +997,8 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
*/ */
public function offsetUnset(mixed $offset) public function offsetUnset(mixed $offset)
{ {
if (!isset($this->_attributes[$offset])) { if (!isset($this->_attributes[$offset])
&& !isset($this->_oldAttributes[$offset])) {
return; return;
} }
unset($this->_attributes[$offset]); unset($this->_attributes[$offset]);