Like other implement ActiveRecord (AR) in many PHP n Ruby Framework, when I work with framework has implemeted it, there are some common method n there are some custom build-in from FW. - Handle log changed (only changedAttributes) in AR: $oldAttributes getOldAttributes() http://www.yiiframework.com/doc-2.0/yii-db-baseactiverecord.html https://github.com/yiisoft/yii2/issues/4086 [5:31:19 PM] dzung nguyen: $log = 'test.txt'; $ln = "\r\n"; file_put_contents($log, $model->getOldAttributes(), FILE_APPEND); [5:33:40 PM] dzung nguyen: n checkout logic in LogRecord::logAfterSave() [5:33:58 PM] dzung nguyen: it calculate what field is need to log
Some tribes of the programmer clan.