Decouple public API from Doctrine\Persistence\Proxy#10832
Conversation
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| public function isUninitializedEntity($obj) |
There was a problem hiding this comment.
you should add the parameter and return types
There was a problem hiding this comment.
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.
if it is an internal API, can't we define the method in the interface directly ?
There was a problem hiding this comment.
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\Proxyin the future.Adding
EntityManager::isUninitializedEntity()will allow userland to decouple from theProxyinterface:before:
after: