[Reflexion] ORM: Behaviors & Filters
Biromain opened this issue · 1 comments
Biromain commented
Could be nice for ORM has behaviors and filters feature.
Why behaviors?
- DRY
- Lambda extension developer (like me) don't needing to care about
- Sluggable: He just need a getAlias()/getSlug() to make his routes (Behavior add column in table/provide method to Entity).
- Tree: He just need a getAncestor()/getDescendant()/...
- ...
- We can apply fixes/bc enhancements for all extensions.
Why filters?
- Apply by default scope/filter to query like locale, state or ownEdit.
- Enabled by default and need call method to disable it because we need to disable&know what we are doing.
- Why not Behaviors provide filters like soft-deletable, publishable_(1.)_, translatable
(1.) I think we need to separate delete state from state
with property deletedAt
(DateTime), with that we can recover to the original state and make treatment like delete/backup soft-delete content.
nibra commented
Development of Filters has started.