From d0e8ecacaee7aaad77d1a6b3572f7bc8a292d557 Mon Sep 17 00:00:00 2001 From: Dominique Feyer Date: Wed, 20 Apr 2016 00:00:04 +0200 Subject: [PATCH] TASK: Add CLI command to remove task --- .../Ttree/Scheduler/Command/TaskCommandController.php | 10 +++++++++- Classes/Ttree/Scheduler/Service/TaskService.php | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Classes/Ttree/Scheduler/Command/TaskCommandController.php b/Classes/Ttree/Scheduler/Command/TaskCommandController.php index f5793d3..972e040 100644 --- a/Classes/Ttree/Scheduler/Command/TaskCommandController.php +++ b/Classes/Ttree/Scheduler/Command/TaskCommandController.php @@ -82,6 +82,14 @@ public function listCommand() { } } + /** + * @param Task $task + */ + public function removeCommand(Task $task) + { + $this->taskService->remove($task); + } + /** * Enable the given persistent class * @@ -126,4 +134,4 @@ protected function tellStatus($message, array $arguments = NULL) { $this->outputLine('%s: %s', array(date(\DateTime::ISO8601), $message)); } -} \ No newline at end of file +} diff --git a/Classes/Ttree/Scheduler/Service/TaskService.php b/Classes/Ttree/Scheduler/Service/TaskService.php index ea3cfe5..c5c823c 100644 --- a/Classes/Ttree/Scheduler/Service/TaskService.php +++ b/Classes/Ttree/Scheduler/Service/TaskService.php @@ -192,6 +192,14 @@ public function create($expression, $task, array $arguments) { return $task; } + /** + * @param Task $task + */ + public function remove(Task $task) + { + $this->taskRepository->remove($task); + } + /** * @param Task $task * @param string $type @@ -237,4 +245,4 @@ protected function assertValidTask(Task $task) { } } -} \ No newline at end of file +}