예제 #1
0
파일: remove_show.php 프로젝트: rsesek/nztv
 public function Fire()
 {
     $show = Show::FetchByName($this->input->_id);
     if (!$show) {
         TaskPump::Pump()->QueueTask(new ErrorTask('Could not find show named "' . $this->input->_id . '"'));
         return;
     }
     try {
         $show->Delete();
     } catch (\phalanx\data\ModelException $e) {
         TaskPump::Pump()->QueueTask(new ErrorTask('An error occurred while deleting the show.'));
         return;
     }
     TaskPump::Pump()->QueueTask(new MessageTask('Deleted ' . $show->name));
 }
예제 #2
0
파일: bump.php 프로젝트: rsesek/nztv
 public function Fire()
 {
     $show = Show::FetchByName($this->input->_id);
     if (!$show) {
         TaskPump::Pump()->QueueTask(new ErrorTask('Could not find show named "' . $this->input->_id . '"'));
         return;
     }
     $show->last_season++;
     $show->last_episode = 0;
     try {
         $show->Update();
     } catch (\phalanx\data\ModelException $e) {
         TaskPump::Pump()->QueueTask(new ErrorTask('An error occurred while updating the record.'));
         return;
     }
     TaskPump::Pump()->QueueTask(new MessageTask('Updated ' . $show->name . ' to ' . $show->last_season . 'x' . $show->last_episode));
 }