Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
All fields will be updated.
If you want to know which fields have been changed, save the original values in afterFind and compare with the new ones in beforeSave.
The ability to update only dirty fields appeared only in the second version.
1. in beforeSave get the object from the database and diff the _attributes property.
2. overload the magic set method, and remember what has changed, writing somewhere the field, the changed and the old value.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question