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)); }
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)); }