|
@@ -100,6 +100,17 @@ abstract class AbstractTreeRepository extends EntityRepository implements Reposi
|
|
|
}
|
|
|
|
|
|
$qb = $this->getChildrenQueryBuilder($node, $direct);
|
|
|
+
|
|
|
+ // We need to remove the ORDER BY DQL part since some vendors could throw an error
|
|
|
+ // in count queries
|
|
|
+ $dqlParts = $qb->getDQLParts();
|
|
|
+
|
|
|
+ // We need to check first if there's an ORDER BY DQL part, because resetDQLPart doesn't
|
|
|
+ // check if its internal array has an "orderby" index
|
|
|
+ if (isset($dqlParts['orderby'])) {
|
|
|
+ $qb->resetDQLPart('orderby');
|
|
|
+ }
|
|
|
+
|
|
|
$aliases = $qb->getRootAliases();
|
|
|
$alias = $aliases[0];
|
|
|
|
|
@@ -171,7 +182,7 @@ abstract class AbstractTreeRepository extends EntityRepository implements Reposi
|
|
|
*
|
|
|
* @return \Doctrine\ORM\QueryBuilder - QueryBuilder object
|
|
|
*/
|
|
|
- abstract public function getNodesHierarchyQueryBuilder($node = null, $direct, array $config, array $options = array(), $includeNode = false);
|
|
|
+ abstract public function getNodesHierarchyQueryBuilder($node = null, $direct = false, array $config = array(), array $options = array(), $includeNode = false);
|
|
|
|
|
|
/**
|
|
|
* Returns a Query configured to return an array of nodes suitable for buildTree method
|
|
@@ -184,7 +195,7 @@ abstract class AbstractTreeRepository extends EntityRepository implements Reposi
|
|
|
*
|
|
|
* @return \Doctrine\ORM\Query - Query object
|
|
|
*/
|
|
|
- abstract public function getNodesHierarchyQuery($node = null, $direct, array $config, array $options = array(), $includeNode = false);
|
|
|
+ abstract public function getNodesHierarchyQuery($node = null, $direct = false, array $config = array(), array $options = array(), $includeNode = false);
|
|
|
|
|
|
/**
|
|
|
* Get list of children followed by given $node. This returns a QueryBuilder object
|