浏览代码

1. getBySortableGroupsQuery() renamed to getBySortableGroupsQueryBuilder() that returns the QueryBuilder instance now
2. implemented new getBySortableGroupsQuery() that uses getBySortableGroupsQueryBuilder() to return the query

toaotc 13 年之前
父节点
当前提交
7cfd938b20
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      lib/Gedmo/Sortable/Entity/Repository/SortableRepository.php

+ 6 - 1
lib/Gedmo/Sortable/Entity/Repository/SortableRepository.php

@@ -44,6 +44,11 @@ class SortableRepository extends EntityRepository
     }
     }
     
     
     public function getBySortableGroupsQuery(array $groupValues=array())
     public function getBySortableGroupsQuery(array $groupValues=array())
+    {
+        return $this->getBySortableGroupsQueryBuilder($groupValues)->getQuery();
+    }
+    
+    public function getBySortableGroupsQueryBuilder(array $groupValues=array())
     {
     {
         $groups = array_combine(array_values($this->config['groups']), array_keys($this->config['groups']));
         $groups = array_combine(array_values($this->config['groups']), array_keys($this->config['groups']));
         foreach ($groupValues as $name => $value) {
         foreach ($groupValues as $name => $value) {
@@ -65,7 +70,7 @@ class SortableRepository extends EntityRepository
                ->setParameter('group'.$i, $value);
                ->setParameter('group'.$i, $value);
             $i++;
             $i++;
         }
         }
-        return $qb->getQuery();
+        return $qb;
     }
     }
     
     
     public function getBySortableGroups(array $groupValues=array())
     public function getBySortableGroups(array $groupValues=array())