public function postToDesignDocForm($r) { $doc = new CouchDB_Document($this->db); $doc->_id = '_design/' . $r->get('title'); if ($r->get('rev')) { $doc->_rev = $r->get('rev'); } $views = '{' . trim($r->get('views')) . '}'; $views = html_entity_decode($views, ENT_COMPAT, 'UTF-8'); $php = CouchDB::decode_json($views); $doc->views = $php->views; $doc->save(); $r->renderRedirect('home'); }
function getBody($decode_json = false) { return $decode_json ? CouchDB::decode_json($this->body) : $this->body; }
function getBodyAsObject() { return CouchDB::decode_json($this->body); }