neat-php / object

Neat Object components
MIT License
4 stars 1 forks source link

Repository decorator redesign #36

Open baukevdw opened 3 years ago

baukevdw commented 3 years ago

The current decorator pattern has some issues. To cope with these issues 2 additional elements will be added.

The first one is the query builder. Instead of modifying queries by passing them through decorators and overriding all methods we could provide the Repository with an immutable query builder that can be used for all methods. Before initialization the query builder can be passed through a set of modifiers to for example filter out the soft deleted records or set a default order.

The second element is a store handler. This is meant to replace the soft deletes, created and updated timestamps. The store handler should be able to modify an entity and change the behavior. Requirements: