Skip to content

Commit

Permalink
Bugfix: items method of appdesk controller uses model::query() to ret…
Browse files Browse the repository at this point in the history
…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 c496934
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions framework/classes/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit c496934

Please sign in to comment.