mscherer 2 年 前
コミット
88c3d0f100
1 ファイル変更4 行追加1 行削除
  1. 4 1
      docs/Behavior/AfterSave.md

+ 4 - 1
docs/Behavior/AfterSave.md

@@ -1,11 +1,14 @@
 # AfterSave Behavior
 # AfterSave Behavior
 
 
-A CakePHP behavior to allow the entity to be available inside afterSave() callback.
+A CakePHP behavior to allow the entity to be available inside afterSave() callback in the state
+it was before the save.
 
 
 ## Introduction
 ## Introduction
 It takes a clone of the entity from beforeSave(). This allows all the
 It takes a clone of the entity from beforeSave(). This allows all the
 info on it to be available in the afterSave() callback or from the outside without resetting (dirty, ...).
 info on it to be available in the afterSave() callback or from the outside without resetting (dirty, ...).
 
 
+This can be useful if one wants to compare what fields got changed, or e.g. for logging the diff.
+
 ### Technical limitation
 ### Technical limitation
 Make sure you do not further modify the entity in the table's beforeSave() then. As this would
 Make sure you do not further modify the entity in the table's beforeSave() then. As this would
 not be part of the cloned and stored entity here.
 not be part of the cloned and stored entity here.