Fixes #1611: Added BaseActiveRecord::markAttributeDirty()

This commit is contained in:
Qiang Xue
2013-12-26 09:46:02 -05:00
parent 3fff4e0304
commit f77e3b4bba
2 changed files with 12 additions and 0 deletions

View File

@ -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