summaryrefslogtreecommitdiff
path: root/app/Api/Subtask.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-05-16 21:07:29 -0400
committerFrederic Guillot <fred@kanboard.net>2016-05-16 21:07:29 -0400
commitb1e2ca00ce7375ffcbe5e927135c8892036e6bd6 (patch)
tree07ce453261f6493de7c901cfd8b4f0d9af85556d /app/Api/Subtask.php
parent4514bc1d4b4abff23902e46da76e70f13a3647eb (diff)
Rename Api classes
Diffstat (limited to 'app/Api/Subtask.php')
-rw-r--r--app/Api/Subtask.php64
1 files changed, 0 insertions, 64 deletions
diff --git a/app/Api/Subtask.php b/app/Api/Subtask.php
deleted file mode 100644
index 782fdb02..00000000
--- a/app/Api/Subtask.php
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-
-namespace Kanboard\Api;
-
-/**
- * Subtask API controller
- *
- * @package api
- * @author Frederic Guillot
- */
-class Subtask extends \Kanboard\Core\Base
-{
- public function getSubtask($subtask_id)
- {
- return $this->subtask->getById($subtask_id);
- }
-
- public function getAllSubtasks($task_id)
- {
- return $this->subtask->getAll($task_id);
- }
-
- public function removeSubtask($subtask_id)
- {
- return $this->subtask->remove($subtask_id);
- }
-
- public function createSubtask($task_id, $title, $user_id = 0, $time_estimated = 0, $time_spent = 0, $status = 0)
- {
- $values = array(
- 'title' => $title,
- 'task_id' => $task_id,
- 'user_id' => $user_id,
- 'time_estimated' => $time_estimated,
- 'time_spent' => $time_spent,
- 'status' => $status,
- );
-
- list($valid, ) = $this->subtaskValidator->validateCreation($values);
- return $valid ? $this->subtask->create($values) : false;
- }
-
- public function updateSubtask($id, $task_id, $title = null, $user_id = null, $time_estimated = null, $time_spent = null, $status = null)
- {
- $values = array(
- 'id' => $id,
- 'task_id' => $task_id,
- 'title' => $title,
- 'user_id' => $user_id,
- 'time_estimated' => $time_estimated,
- 'time_spent' => $time_spent,
- 'status' => $status,
- );
-
- foreach ($values as $key => $value) {
- if (is_null($value)) {
- unset($values[$key]);
- }
- }
-
- list($valid, ) = $this->subtaskValidator->validateApiModification($values);
- return $valid && $this->subtask->update($values);
- }
-}