Skip to content

Commit

Permalink
fix sort (need refacto)
Browse files Browse the repository at this point in the history
  • Loading branch information
Acrack committed Jun 3, 2014
1 parent 33b76c8 commit f80b1d7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions Controller/CrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,16 +268,21 @@ protected function doIndex()
{
$entityClass = ltrim($this->getEntityClass(), '\\');

$query = $this
$queryBuilder = $this
->getContextRepository()
->createContextQueryBuilder($entityClass)
->createContextQueryBuilder($entityClass);

foreach ($this->getFields()['join'] as $key => $field) {
$queryBuilder
->join('e.'.$field, $key);
}

$query = $queryBuilder
->getQuery()
->setHint(
Query::HINT_CUSTOM_OUTPUT_WALKER,
'Gedmo\Translatable\Query\TreeWalker\TranslationWalker'
)
// ->getResult()
;
);

return $this->renderIndex($query);
}
Expand Down
2 changes: 1 addition & 1 deletion Subscriber/KnpSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function setRequest($request)
public static function getSubscribedEvents()
{
return array(
// 'knp_pager.items' => array('items', 1)
'knp_pager.items' => array('items', 1)
);
}

Expand Down

0 comments on commit f80b1d7

Please sign in to comment.