Jira issue originally created by user ghennady:
Hi, here problem with cloning \Doctrine\ORM\QueryBuilder
$queryBuilder = new QueryBuilder($em);
$copy = clone $queryBuilder;
count($queryBuilder->getParameters()) // equals 2
public function **clone
$this->parameters = clone $this->parameters;
Comment created by @ocramius:
Is $copy = clone $queryBuilder(); a typo?
$copy = clone $queryBuilder();
Comment created by ghennady:
Sorry, this is a typo, was meant: $copy = clone $queryBuilder;
This is being handled at DDC-1936 (#404)
Hi. Thanks for the quick response.
I looked at the changes, and have a question: whether you need to reset the parameters when cloning? Thus broken backward compatibility with versions <2.3.
Actually, I just implemented your expected behaviour (see tests), which is compatible with what the AbstractQuery does. It can also be done the other way around, waiting for feedback by [~beberlei] :)
Ah, nevermind. You're right. Will change my code :)
Issue was closed with resolution "Fixed"