Add named parameters support to ServerStatsController.
parent
69891c877e
commit
e8a866e504
|
@ -38,8 +38,17 @@ class ServerStatsController extends AppController {
|
||||||
public function index() {
|
public function index() {
|
||||||
$this->ServerStat->recursive = 0;
|
$this->ServerStat->recursive = 0;
|
||||||
|
|
||||||
$options = '';
|
$named_params = $this->request->params['named'];
|
||||||
$stats = $this->ServerStat->find('all', $options);
|
if ( $named_params ) {
|
||||||
|
$this->FilterComponent = $this->Components->load('Filter');
|
||||||
|
$conditions = $this->FilterComponent->buildFilter($named_params);
|
||||||
|
} else {
|
||||||
|
$conditions = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
$stats = $this->ServerStat->find('all', ['conditions'=>$conditions,
|
||||||
|
'order' => array('TimeStamp ASC'),
|
||||||
|
]);
|
||||||
$this->set(array(
|
$this->set(array(
|
||||||
'serverstats' => $stats,
|
'serverstats' => $stats,
|
||||||
'_serialize' => array('serverstats')
|
'_serialize' => array('serverstats')
|
||||||
|
|
Loading…
Reference in New Issue