Permalink
Browse files

Bugfix: items method of appdesk controller uses model::query() to ret…

…rieve a query class, and then use before_where and before_order_by mechanisms
  • Loading branch information...
felixgilles committed May 13, 2014
1 parent 3073f3f commit c4969349e94f09cf8329df1ccc6c7f9562dafcee
Showing with 3 additions and 2 deletions.
  1. +3 −2 framework/classes/controller.php
@@ -152,7 +152,7 @@ protected function items(array $config, $only_count = false)
$model = $config['model'];
$query = \Nos\Orm\Query::forge($model, $model::connection());
$query = $model::query();
foreach ($config['related'] as $related) {
$query->related($related);
}
@@ -211,7 +211,8 @@ protected function items(array $config, $only_count = false)
$objects = $new_query->execute($query->connection())->as_array('group_by_pk');
if (!empty($objects)) {
$query = \Nos\Orm\Query::forge($model)->where(array($select, 'in', array_keys($objects)));
$query = $model::query();
$query->where(array($select, 'in', array_keys($objects)));
foreach ($config['related'] as $related) {
$query->related($related);
}

0 comments on commit c496934

Please sign in to comment.