-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate custom ObjectRepository
implementations
#9533
Conversation
d660038
to
bf86e53
Compare
2ef0669
to
1563960
Compare
d28e9e1
to
71a70c5
Compare
I'd like to voice an objection to this. Still, I have a few concerns:
Admittedly, these are both minor - my main concern was being able to implement |
Indeed, Regarding the other concerns:
Looking at the alternatives (#9531 mainly), this PR still seems to be the best option to me. |
For a bit of context, I've been working on a library (very wip) that provides an opinionated entity repository (iterable, countable, read-only vs writeable implementations). It's optimized for large data sets.
Excluding was an attempt to lock user's out of "doing whatever they want" outside of the repo itself.
Clean was a poor word choice on my part. My library's "repository" classes are abstract and force you implement This change throws a bit of a wrench in my vision but isn't something I can't work around. |
71a70c5
to
06c95ed
Compare
* 2.12.x: Deprecate custom ObjectRepository implementations (doctrine#9533) Fix types on walkLiteral() and walkLikeExpression() (doctrine#9566)
Alternative approach to #9531.
Although the documentation never mentions it, it is currently possible to use an implementation of
ObjectRepository
as repository class that does not extendEntityRepository
. A caller ofEntityManager::getRepository()
will probably not expect not getting anEntityRepository
as return value.This is why I'd like to deprecate that possibility. This will also allow us to safely use
EntityRepository
as a native return type in 3.0.