Fixed yii\db\ActiveRecord does not updates attribute specified at optimisticLock() after save

This commit is contained in:
Klimov Paul
2015-05-26 11:53:34 +03:00
parent 2434511c6e
commit 51a442d6c8
10 changed files with 107 additions and 1 deletions

View File

@@ -725,6 +725,9 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
foreach ($values as $name => $value) {
$changedAttributes[$name] = isset($this->_oldAttributes[$name]) ? $this->_oldAttributes[$name] : null;
$this->_oldAttributes[$name] = $value;
if ($name === $lock) {
$this->$lock = $value;
}
}
$this->afterSave(false, $changedAttributes);