Skip to content

Commit

Permalink
TASK: Add CLI command to remove task
Browse files Browse the repository at this point in the history
  • Loading branch information
dfeyer committed Apr 19, 2016
1 parent 34432d7 commit d0e8eca
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion Classes/Ttree/Scheduler/Command/TaskCommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ public function listCommand() {
}
}

/**
* @param Task $task
*/
public function removeCommand(Task $task)
{
$this->taskService->remove($task);
}

/**
* Enable the given persistent class
*
Expand Down Expand Up @@ -126,4 +134,4 @@ protected function tellStatus($message, array $arguments = NULL) {
$this->outputLine('%s: %s', array(date(\DateTime::ISO8601), $message));
}

}
}
10 changes: 9 additions & 1 deletion Classes/Ttree/Scheduler/Service/TaskService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -237,4 +245,4 @@ protected function assertValidTask(Task $task) {
}
}

}
}

0 comments on commit d0e8eca

Please sign in to comment.