mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 05:48:11 +08:00
Fixes #1611: Added BaseActiveRecord::markAttributeDirty()
This commit is contained in:
@ -493,6 +493,17 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Marks an attribute dirty.
|
||||
* This method may be called to force updating a record when calling [[update()]],
|
||||
* even if there is no change being made to the record.
|
||||
* @param string $name the attribute name
|
||||
*/
|
||||
public function markAttributeDirty($name)
|
||||
{
|
||||
unset($this->_oldAttributes[$name]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a value indicating whether the named attribute has been changed.
|
||||
* @param string $name the name of the attribute
|
||||
|
||||
Reference in New Issue
Block a user