Skip to content
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

DDC-822: Query with detached Entity as parameter fails to execute #5341

Closed
doctrinebot opened this issue Sep 30, 2010 · 4 comments
Closed

DDC-822: Query with detached Entity as parameter fails to execute #5341

doctrinebot opened this issue Sep 30, 2010 · 4 comments
Assignees
Labels
Milestone

Comments

@doctrinebot
Copy link

Jira issue originally created by user nicokaiser:

When dealing with detached entities, e.g. with the QueryCache, you cannot use these entities as parameters for other Query.

Example:

$em->detach($user);
$query = $em->createQuery('SELECT a FROM Address a WHERE a.User = ?1');
$query->setParameter(1, $user); // $user is detached

As $user is detached, the EntityManager does not have its identifier, so Query::_doExecute fails. (There is a "//TODO: Check that $value is MANAGED?" line near the failing line).

@doctrinebot
Copy link
Author

Comment created by nicokaiser:

This patch should fix Doctrine\ORM\Query to work with detached Entities.

@doctrinebot
Copy link
Author

Comment created by @beberlei:

Did some changes to the patch, but overally its now committed!

@doctrinebot
Copy link
Author

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added this to the 2.0-RC1 milestone Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
@doctrinebot
Copy link
Author

Imported 1 attachments from Jira into https://gist.github.com/f5326cd5233646eb75cb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants