Initial support for filtering events.
First I tell extractNamedParams() which params I care about (ignore the rest), then I loop through the returned results and build my query via named params. Finally I pass the named params into the $conditions array for paginate to use.
This commit is contained in:
parent
cc4af23115
commit
633aa7a9ad
|
@ -8,6 +8,17 @@ public function index() {
|
||||||
$this->loadModel('Monitor');
|
$this->loadModel('Monitor');
|
||||||
$conditions = array();
|
$conditions = array();
|
||||||
|
|
||||||
|
$named = $this->extractNamedParams(
|
||||||
|
array('MonitorId')
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($named) {
|
||||||
|
foreach ($named as $key => $value) {
|
||||||
|
$$key = array($key => $value);
|
||||||
|
array_push($conditions, $$key);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
$events_per_page = Configure::read('ZM_WEB_EVENTS_PER_PAGE');
|
$events_per_page = Configure::read('ZM_WEB_EVENTS_PER_PAGE');
|
||||||
|
|
||||||
$this->paginate = array(
|
$this->paginate = array(
|
||||||
|
|
Loading…
Reference in New Issue