private function parseRow($row) { if ($row == null) { return null; } $page = new Wsm_Video(); $page->setId($row['id']); $page->setYoutube($row['youtube']); return $page; }
public function saveAction() { $video = new Wsm_Video(); if ($this->has('id')) { $video->setId($this->get('id')); } $video->setYoutube($this->get('youtube')); $videoService = new Wsm_Db_Video(); try { $videoService->save($video); $this->redirect('video/index?msg=saved'); } catch (Exception $e) { $this->redirect('video/index?msg=save_error'); } }