public function render() { $properties = array('message' => $this->message, 'code' => $this->code); if (ini_get('display_errors')) { $properties['data'] = array('file' => $this->file, 'line' => $this->line, 'function' => $this->function, 'class' => $this->class, 'args' => $this->args, 'info' => $this->info); } $content = json_encode(array('version' => '1.0', 'errors' => array($properties))); $this->setContent($content); return parent::render(); }
public function render() { $model = $this->getModel(); if (Library\StringInflector::isPlural($this->getName())) { $data = array('settings' => $model->getRowset()->toArray()); } else { $data = $model->getRow()->toArray(); } $this->setContent($data); return parent::render(); }
protected function _getRow() { $row = $this->getModel()->getRow(); $data = parent::_getRow(); $status = $row->getStatus() !== Library\Database::STATUS_FAILED; $data['status'] = $status; if ($data === false) { $data['error'] = $row->getStatusMessage(); } return $data; }