joomla-pythagoras icon indicating copy to clipboard operation
joomla-pythagoras copied to clipboard

[Reflexion] ORM: Behaviors & Filters

Open Biromain opened this issue 9 years ago • 1 comments

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.

See DoctrineExtensions

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

See Doctrine/ORM Filters

(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.

Biromain avatar Sep 27 '16 12:09 Biromain

Development of Filters has started.

nibra avatar Nov 12 '16 22:11 nibra