Skip to content

Loading…

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

Open
doctrinebot opened this Issue · 2 comments

2 participants

@doctrinebot

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);
}
@doctrinebot

Comment created by nousefreak:

I wrote a test showing the issue.

NoUseFreak@8574b79

@doctrinebot

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.