modify
This commit is contained in:
@@ -968,7 +968,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
|
||||
*/
|
||||
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)
|
||||
{
|
||||
if (!isset($this->_attributes[$offset])) {
|
||||
if (!isset($this->_attributes[$offset])
|
||||
&& !isset($this->_oldAttributes[$offset])) {
|
||||
return;
|
||||
}
|
||||
unset($this->_attributes[$offset]);
|
||||
|
||||
Reference in New Issue
Block a user