Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow pre- and post-processing values #363

Open
Tigrov opened this issue Jun 11, 2024 · 1 comment
Open

Allow pre- and post-processing values #363

Tigrov opened this issue Jun 11, 2024 · 1 comment
Labels
type:enhancement Enhancement

Comments

@Tigrov
Copy link
Member

Tigrov commented Jun 11, 2024

Allow processing events

  • After read
  • Before insert
  • After insert
  • Before update
  • After update
  • Before save (before insert or update)
  • After save (after insert or update)
  • Before delete
  • After delete

Could be realized as a trait

@samdark samdark added the type:enhancement Enhancement label Jun 11, 2024
@samdark
Copy link
Member

samdark commented Jun 11, 2024

It could be done in two ways:

  1. Overriding methods as in Yii2. This is alright, but there will be conflicts when multiple traits are used.
  2. Events is a better way since you can add multiple behaviors simultaneously and, also, can handle these outside of the AR itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Enhancement
Projects
None yet
Development

No branches or pull requests

2 participants