Skip to content

Loading…

DDC-797: WHERE EXISTS example code doesn't make sense in docs #5312

Closed
doctrinebot opened this Issue · 2 comments

1 participant

@doctrinebot

Jira issue originally created by user mjh_ca:

Example for "WHERE EXISTS" in DQL section of docs currently reads:

$query = $em->createQuery('SELECT u.id FROM CmsUser u WHERE EXISTS (SELECT p.phonenumber FROM CmsPhonenumber p WHERE p.phonenumber = u.id)');

But, p.phonenumber = u.id* doesn't make sense - you're comparing the PK of a CmsPhoneNumber to a PK of a CmsUser. I think it is supposed to be *p.user = u.id :

$query = $em->createQuery('SELECT u.id FROM CmsUser u WHERE EXISTS (SELECT p.phonenumber FROM CmsPhonenumber p WHERE p.user = u.id)');

Also consider updating the test at Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php line 466 to match.

@doctrinebot

Comment created by @beberlei:

Fixed

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added this to the 2.0-RC1 milestone
@doctrinebot doctrinebot closed this
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.