Skip to content

Loading…

DDC-1356: DQL does not accept a parameter containing Entities #1974

Closed
doctrinebot opened this Issue · 3 comments

2 participants

@doctrinebot

Jira issue originally created by user @guilhermeblanco:

Currently, it is impossible to provide an argument that is a collection of Entities. Example:

$userA = new CmsUser;
$userA->name = 'Benjamin';
$userA->username = 'beberlei';
$userA->status = 'developer';
$this->_em->persist($userA);

$userB = new CmsUser;
$userB->name = 'Roman';
$userB->username = 'romanb';
$userB->status = 'developer';
$this->_em->persist($userB);

$this->_em->flush();
$this->_em->clear();

$query = $this->_em->createQuery("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u IN (?0)");
$query->setParameter(0, array($userA, $userB));

Returns this error currently:

Object of class Doctrine\Tests\Models\CMS\CmsUser could not be converted to string
@doctrinebot

Comment created by @guilhermeblanco:

Fixed in 3b3186e

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot

Comment created by @beberlei:

Merged

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