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

Open
opened 2026-01-22 14:05:16 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Jan 23, 2013).

Originally assigned to: @beberlei on GitHub.

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);
}
Originally created by @doctrinebot on GitHub (Jan 23, 2013). Originally assigned to: @beberlei on GitHub. 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); } ```
admin added the Improvement label 2026-01-22 14:05:16 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jan 23, 2013):

Comment created by nousefreak:

I wrote a test showing the issue.

8574b79fd3

@doctrinebot commented on GitHub (Jan 23, 2013): Comment created by nousefreak: I wrote a test showing the issue. https://github.com/NoUseFreak/doctrine2/commit/8574b79fd3d245532bbe7e310c5cbe083892057a
Author
Owner

@doctrinebot commented on GitHub (May 4, 2013):

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.

@doctrinebot commented on GitHub (May 4, 2013): 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2834