diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-05-16 21:07:29 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-05-16 21:07:29 -0400 |
commit | b1e2ca00ce7375ffcbe5e927135c8892036e6bd6 (patch) | |
tree | 07ce453261f6493de7c901cfd8b4f0d9af85556d /app/Api/TaskLinkApi.php | |
parent | 4514bc1d4b4abff23902e46da76e70f13a3647eb (diff) |
Rename Api classes
Diffstat (limited to 'app/Api/TaskLinkApi.php')
-rw-r--r-- | app/Api/TaskLinkApi.php | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/app/Api/TaskLinkApi.php b/app/Api/TaskLinkApi.php new file mode 100644 index 00000000..8c02c524 --- /dev/null +++ b/app/Api/TaskLinkApi.php @@ -0,0 +1,79 @@ +<?php + +namespace Kanboard\Api; + +use Kanboard\Core\Base; + +/** + * TaskLink API controller + * + * @package Kanboard\Api + * @author Frederic Guillot + */ +class TaskLinkApi extends Base +{ + /** + * Get a task link + * + * @access public + * @param integer $task_link_id Task link id + * @return array + */ + public function getTaskLinkById($task_link_id) + { + return $this->taskLink->getById($task_link_id); + } + + /** + * Get all links attached to a task + * + * @access public + * @param integer $task_id Task id + * @return array + */ + public function getAllTaskLinks($task_id) + { + return $this->taskLink->getAll($task_id); + } + + /** + * Create a new link + * + * @access public + * @param integer $task_id Task id + * @param integer $opposite_task_id Opposite task id + * @param integer $link_id Link id + * @return integer Task link id + */ + public function createTaskLink($task_id, $opposite_task_id, $link_id) + { + return $this->taskLink->create($task_id, $opposite_task_id, $link_id); + } + + /** + * Update a task link + * + * @access public + * @param integer $task_link_id Task link id + * @param integer $task_id Task id + * @param integer $opposite_task_id Opposite task id + * @param integer $link_id Link id + * @return boolean + */ + public function updateTaskLink($task_link_id, $task_id, $opposite_task_id, $link_id) + { + return $this->taskLink->update($task_link_id, $task_id, $opposite_task_id, $link_id); + } + + /** + * Remove a link between two tasks + * + * @access public + * @param integer $task_link_id + * @return boolean + */ + public function removeTaskLink($task_link_id) + { + return $this->taskLink->remove($task_link_id); + } +} |