Announcement

Collapse
No announcement yet.

Passing information from beforeSave to afterSave

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Passing information from beforeSave to afterSave

    Is it possible to pass information from one hook to another? I often need to know what changed with a record, but I can't know exactly until the afterSave hook triggers. By then, the information I needed from the beforeSave hook is gone. Is it possible to pass an array from one hook to another?

  • #2
    Create a non-storable field in your entity and use it to pass the information.

    Or just create two methods in the entity class: setMyData(array $data), getMyData(): array.

    Comment

    Working...
    X