Does yii have some kind of tracking of touched/changed fields that can be used on the Update action?
Thank you.
Does yii have some kind of tracking of touched/changed fields that can be used on the Update action?
Thank you.
Yii 1.1 doesn’t, but Yii 2 has the $dirtyAttributes property.
It shouldn’t be too difficult to implement this as a behavior. One option is to save the attributes to a separate array when you initially fetch the record, then compare them to the current model attributes on request, to determine which have changed.
Thank you for the suggestion! Since I only needed that on one controller, I did something like that manually.
I might investigate the behavior alternative later. ThankYou