'service_current_check_attempt', 'max_check_attempts' => 'service_max_check_attempts' ); if ($params === null) { $query = ServiceStatusView::fromRequest( $this->_request, $columns )->getQuery(); } else { $params['backend'] = $this->_request->getParam('backend'); $query = ServiceStatusView::fromParams( $params, $columns )->getQuery(); } $this->handleFormatRequest($query); return $query->paginate(); } private function handleFormatRequest($query) { if ($this->_getParam('format') === 'sql' && IcingaConfig::app()->global->get('environment', 'production') === 'development') { echo '
' . htmlspecialchars(wordwrap($query->dump())) . ''; exit; } if ($this->_getParam('format') === 'json' || $this->_request->getHeader('Accept') === 'application/json') { header('Content-type: application/json'); echo json_encode($query->fetchAll()); exit; } if ($this->_getParam('format') === 'csv' || $this->_request->getHeader('Accept') === 'text/csv') { Csv::fromQuery($query)->dump(); exit; } } } // @codingStandardsIgnoreEnd