Passing information from beforeSave to afterSave

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bandtank
    Active Community Member
    • Mar 2017
    • 385

    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?
  • yuri
    Member
    • Mar 2014
    • 8669

    #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.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    Working...