yiisoft / active-record

Active Record database abstraction layer
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
68 stars 28 forks source link

Allow pre- and post-processing values #363

Open Tigrov opened 3 months ago

Tigrov commented 3 months ago

Allow processing events

Could be realized as a trait

samdark commented 3 months ago

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.