-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Add ObjectManager::isUninitializedObject() #334
Conversation
a75a649
to
f6edbfd
Compare
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.
I don't think any API of doctrine/persistence
uses the term Entity
right now, which is a term used only by the ORM project but not by the ODM.
src/Persistence/ObjectManager.php
Outdated
@@ -9,6 +9,8 @@ | |||
|
|||
/** | |||
* Contract for a Doctrine persistence layer ObjectManager class to implement. | |||
* | |||
* @method bool isUninitializedEntity(mixed $value) |
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.
should this be mixed
or object
?
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.
it's mixed
because this is commonly used against any values, eg in the UoW
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.
The object manager manages objects only, so object $object
would indeed make sense here imho. It would also be consistent with all other methods on this interface.
f6edbfd
to
5da35d4
Compare
OK, renamed to |
5da35d4
to
b980121
Compare
Wrong branch then? |
The base branch was changed.
I just created branch 3.3.x and changed the target of this PR. But I don't have permission to update the default branch on github. |
Having the stable branch as the default branch is the policy for this repository AFAIK, having the next minor as default branch is a policy for the ODM, and maybe a few more, but not this one, so you did well. |
Thanks @nicolas-grekas ! |
For 3.3
Adding
ObjectManager::isUninitializedObject()
will allow userland to decouple from theProxy
interface:before:
after:
Also, I removed
Proxy::__setInitialized()
as I figured out it shouldn't be exposed as public API and it should remain an internal concern.