-
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
Decouple public API from Doctrine\Persistence\Proxy #10832
Conversation
lib/Doctrine/ORM/EntityManager.php
Outdated
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function isUninitializedEntity($obj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should add the parameter and return types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return type done, mixed
for param is not compatible with PHP 7.1. @inheritDoc
to the rescue, from doctrine/persistence#334
/** | ||
* @internal | ||
* | ||
* @method void __setInitialized(bool $initialized) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it is an internal API, can't we define the method in the interface directly ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not possible because this overlaps with exiting declarations on legacy Proxy interfaces / implementations.
826b87e
to
89cbb6f
Compare
PR green 🍏 (ignoring unrelated doc failures.) |
This changes code from not requiring the EntityManager, to requiring the entity manager to make this check. Are we ok with this, since explicit proxy loading puts the code into "persistence context" that probably has the entity manager already? |
That's my though also yes: the code shouldn't care about proxy or not (as stated in the doc). But when caring, it means you have the EM not too far away (if not already there). The concept of a Doctrine proxy is in the same domain as Doctrine ORM/ODM in this context. |
a5d233c
to
c22f345
Compare
c22f345
to
54e6f5a
Compare
Related to doctrine/persistence#334
On the path to deprecating
Doctrine\Persistence\Proxy
in the future.Adding
EntityManager::isUninitializedEntity()
will allow userland to decouple from theProxy
interface:before:
after: