ideas
ideas copied to clipboard
Adding repository middlewares
trafficstars
This is an idea for a theoretical issue, that I did not encounter yet, but it could happen. Consider the following: You create a new custom repository to do something with the entries. For instance, you want to add a global scope to filter all entries. Now, an Addon comes and does the same and wants to add another customer repository to do something else with the entries. In this scenario one of both would be remove, because only one instance of a repository can exist.
Would a solution be to introduce "repository middlewares", so that you won't have to create your own custom repository, but simply add a middleware to do anything the return values of each repository function?