private function parseRow($row) { if ($row == null) { return null; } $page = new Wsm_Page(); $page->setId($row['id']); $page->setTitle($row['title']); $page->setContent($row['content']); return $page; }
public function saveAction() { if ($this->has('id')) { $page = new Wsm_Page(); $page->setId($this->get('id')); $page->setTitle($this->get('title')); $page->setContent($this->get('content')); $pageDb = new Wsm_Db_Page(); try { $pageDb->save($page); $this->redirect('pages/index?msg=saved'); } catch (Exception $e) { } } $this->redirect('pages/index?msg=save_error'); }