Skip to content


DDC-2034: getPartialReference returns partial entities for non existent entities #2712

doctrinebot opened this Issue · 4 comments

2 participants


Jira issue originally created by user deatheriam:

$variant = $em->getPartialReference('Entity\Variant', -1);
echo $variant->getVariantId();

prints -1. Is it an expected behavior or a bug? Shouldn't a check be made to prevent creating new instances for ids that do not exist?


Comment created by stof:

Well, the purpose of getPartialReference is to return a reference without querying the database. So it cannot know if the id exists.


Comment created by deatheriam:

Ok, in that case a user is responsible for providing a valid id. But what is a use case for such an entity? Can someone give me a real example?


Comment created by @beberlei:

the use case was partially removed by proxy objects now being capable of returning the id without querying.


Issue was closed with resolution "Invalid"

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.