summaryrefslogtreecommitdiff
path: root/app/Api/SubtaskApi.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-06-26 10:25:13 -0400
committerFrederic Guillot <fred@kanboard.net>2016-06-26 10:25:13 -0400
commit4a230d331ec220fc32a48525afb308af0d9787fa (patch)
tree514aa3d703155b7f97a2c77147c9fd74cef60f84 /app/Api/SubtaskApi.php
parent922e0fb6de06a98774418612e0b0f75af72b6dbb (diff)
Added application and project roles validation for API procedure calls
Diffstat (limited to 'app/Api/SubtaskApi.php')
-rw-r--r--app/Api/SubtaskApi.php66
1 files changed, 0 insertions, 66 deletions
diff --git a/app/Api/SubtaskApi.php b/app/Api/SubtaskApi.php
deleted file mode 100644
index 5764ff7d..00000000
--- a/app/Api/SubtaskApi.php
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-
-namespace Kanboard\Api;
-
-use Kanboard\Core\Base;
-
-/**
- * Subtask API controller
- *
- * @package Kanboard\Api
- * @author Frederic Guillot
- */
-class SubtaskApi extends Base
-{
- public function getSubtask($subtask_id)
- {
- return $this->subtaskModel->getById($subtask_id);
- }
-
- public function getAllSubtasks($task_id)
- {
- return $this->subtaskModel->getAll($task_id);
- }
-
- public function removeSubtask($subtask_id)
- {
- return $this->subtaskModel->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->subtaskModel->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->subtaskModel->update($values);
- }
-}