Skip to content

Observe after access #441

@cajoy

Description

@cajoy

Add a new hook called loaded. It should be triggered whenever model data from the database is returned back to the caller (i.e. find but also create or prototype.updateAttributes) and the context should provide only ctx.instance, no ctx.data. For "batch" load like find, the hook should be fired multiple times, once for each model instance loaded.


The original issue description

I see there is couple of observers such as "access", "create" and etc.

What I need is "after find".

The reason is: I need to encrypt/decrypt data in database.

So basically before save I can encrypt data with the key.
But I can't decrypt data after find.

I've tried with getter/setter but it doesn't work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions