Skip to content

Why afterFind is triggered always before beforeSave? #6088

Closed
@santiagosemhan

Description

@santiagosemhan

There are situations you want to add extra fields to return to the client that alters the request.objects. For instance, when you want to calculate some field in server and then add it to the response.
This "extra field" is passing always to the beforeSave, so this "extra" is pretended to be saved into the object. Currently, I make an unset for the "extra field" in beforeSave and problem solved.
So, my question here is, Why afterFind is triggered before beforeSave? and Is there another way to do this (add extra field to the response)?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions