Details
Description
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);
}