Add named parameter filtering to Storage controller
parent
4472269f3c
commit
494be9c0ef
|
@ -33,8 +33,15 @@ class StorageController extends AppController {
|
||||||
public function index() {
|
public function index() {
|
||||||
$this->Storage->recursive = -1;
|
$this->Storage->recursive = -1;
|
||||||
|
|
||||||
$options = '';
|
$named_params = $this->request->params['named'];
|
||||||
$storage_areas = $this->Storage->find('all',$options);
|
if ( $named_params ) {
|
||||||
|
$this->FilterComponent = $this->Components->load('Filter');
|
||||||
|
$conditions = $this->FilterComponent->buildFilter($named_params);
|
||||||
|
} else {
|
||||||
|
$conditions = array();
|
||||||
|
}
|
||||||
|
$options = ['conditions'=>&$conditions];
|
||||||
|
$storage_areas = $this->Storage->find('all', $options);
|
||||||
require_once __DIR__ .'/../../../includes/Storage.php';
|
require_once __DIR__ .'/../../../includes/Storage.php';
|
||||||
|
|
||||||
foreach ($storage_areas as &$s) {
|
foreach ($storage_areas as &$s) {
|
||||||
|
|
Loading…
Reference in New Issue