Skip to content


DDC-2254: Exporting and restoring a query. #2954

doctrinebot opened this Issue · 2 comments

2 participants


Jira issue originally created by user nousefreak:

When you have a queryBuilder and you want to break it down using getDQLParts, You can't restore it by looping over the parts and adding them.

This is what I am doing:

$parts = $qb->getDQLParts();

// save the parts and use them in a different environment.

$newQb = $em->createQueryBuilder();
foreach ($parts as $name => $part) {
  $newQb->add($name, $part);

Comment created by nousefreak:

I wrote a test showing the issue.



Comment created by @beberlei:

This is not a bug, because restoring queries is not yet a feature of the QueryBuilder. Marking as possible improvement for future.

@beberlei beberlei was assigned by doctrinebot
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.