예제 #1
0
파일: Video.php 프로젝트: posiadacz/wsm
 private function parseRow($row)
 {
     if ($row == null) {
         return null;
     }
     $page = new Wsm_Video();
     $page->setId($row['id']);
     $page->setYoutube($row['youtube']);
     return $page;
 }
예제 #2
0
 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');
     }
 }