mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Merge / extend ObjectRepository with Collection interfaces (3.0)
#5445
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @guiwoda on GitHub (Mar 6, 2017).
I'm opening this issue as a proposal and a place to debate this. I can (and want to, if you guys agree) implement this on ORM.NEXT, so it's not only a feature request! I just know beforehand that it'll be a lot of code changes, and don't want to send a PR without chatting a bit first.
BTW, I know of doctrine-dev IRC, but I don't usually get much feedback there, so don't be mad at me for trying something different this time 😅
Repository pattern
From PoEAA: (The repository) Mediates between the domain and data mapping layers using a collection-like interface for accessing domain objects.
Proposal
Make repositories expose a collection-like interface. Then, make both repositories and collections share implementations.
Examples
Iterable repositories
Associations as repositories
Aggregate queries could be also lazy loaded and handled with a single API:
Modeling system facades:
@guiwoda commented on GitHub (Mar 6, 2017):
May be related to https://github.com/doctrine/doctrine2/issues/6311