浏览代码

Update AfterSave.md

Mark Scherer 1 年之前
父节点
当前提交
c1a37e884c
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      docs/Behavior/AfterSave.md

+ 2 - 2
docs/Behavior/AfterSave.md

@@ -1,6 +1,6 @@
 # AfterSave Behavior
 
-A CakePHP behavior to allow the entity to be available inside afterSave() callback in the state
+A CakePHP behavior that allows the entity to be available after the save in the state
 it was before the save.
 It also allows it to be available outside of the afterSave() callback later on, where needed.
 
@@ -22,7 +22,7 @@ $this->addBehavior('Tools.AfterSave', $options);
 
 Then inside your table you can do:
 ```php
-public function afterSave(Event $event, EntityInterface $entity, ArrayObject $options) {
+public function afterSave(Event $event, EntityInterface $entity, ArrayObject $options): void {
     $entityBefore = $this->getEntityBeforeSave();
     // Now you can check diff dirty fields etc
 }