set($this->Monitor->enumValues()); } public function beforeFilter() { parent::beforeFilter(); } /** * index method * * @return void */ public function index() { $this->Monitor->recursive = 0; $this->FilterComponent = $this->Components->load('Filter'); // The columns of Monitors and of the tables find() joins at recursive 0 // (hasOne, belongsTo), plus GroupId, served by the Groups_Monitors join // below. Anything else would reach MySQL as an unknown column and come // back as a 500. $fields = array('Monitor' => array_keys($this->Monitor->schema())); foreach (array_merge(array_keys($this->Monitor->hasOne), array_keys($this->Monitor->belongsTo)) as $alias) { $fields[$alias] = array_keys($this->Monitor->{$alias}->schema()); } if ($this->request->params['named']) { $filter_params = $this->request->params['named']; } else { // The query string filters like the equivalent named parameters, so // /monitors.json?Enabled=1 is no longer ignored. The API client sends its // credentials and transport keys alongside them; those are not fields. $filter_params = $this->request->query; foreach (array('token', 'auth', 'user', 'pass', 'username', 'password', 'stateful', 'url', 'ext') as $transport) { unset($filter_params[$transport]); } // Keys that cannot be a field, such as a client's _=