Allow extend query on reorder controller, on 'simple' sortMode

This commit is contained in:
Jofry 2015-10-15 17:01:44 +11:00 committed by Samuel Georges
parent 82a385b338
commit f0b4691168
1 changed files with 13 additions and 4 deletions

View File

@ -215,10 +215,9 @@ class ReorderController extends ControllerBehavior
$records = null;
if ($this->sortMode == 'simple') {
$records = $model
->orderBy($model->getSortOrderColumn())
->get()
;
$records = $model->orderBy($model->getSortOrderColumn());
$this->controller->reorderExtendQuery($records);
$records = $records->get();
}
elseif ($this->sortMode == 'nested') {
$records = $model->getEagerRoot();
@ -227,6 +226,16 @@ class ReorderController extends ControllerBehavior
return $records;
}
/**
* Extend the query used for finding reorder records. Extra conditions
* can be applied to the query, for example, $query->withTrashed();
* @param October\Rain\Database\Builder $query
* @return void
*/
public function reorderExtendQuery($query)
{
}
//
// Widgets
//