Update modeladmin.md

DataList is immutable, so need to assign.
This commit is contained in:
Simon Welsh 2014-06-05 15:03:02 +10:00
parent 89333d575d
commit 81e6c806a7

View File

@ -132,7 +132,7 @@ For example, we might want to exclude all products without prices in our sample
$list = parent::getList();
// Always limit by model class, in case you're managing multiple
if($this->modelClass == 'Product') {
$list->exclude('Price', '0');
$list = $list->exclude('Price', '0');
}
return $list;
}
@ -155,7 +155,7 @@ For example, we might want to have a checkbox which limits search results to exp
$list = parent::getList();
$params = $this->request->requestVar('q'); // use this to access search parameters
if($this->modelClass == 'Product' && isset($params['ExpensiveOnly']) && $params['ExpensiveOnly']) {
$list->exclude('Price:LessThan', '100');
$list = $list->exclude('Price:LessThan', '100');
}
return $list;
}