diff options
| author | Frederic Guillot <fred@kanboard.net> | 2016-06-26 10:25:13 -0400 |
|---|---|---|
| committer | Frederic Guillot <fred@kanboard.net> | 2016-06-26 10:25:13 -0400 |
| commit | 4a230d331ec220fc32a48525afb308af0d9787fa (patch) | |
| tree | 514aa3d703155b7f97a2c77147c9fd74cef60f84 /app/Model/TaskLinkModel.php | |
| parent | 922e0fb6de06a98774418612e0b0f75af72b6dbb (diff) | |
Added application and project roles validation for API procedure calls
Diffstat (limited to 'app/Model/TaskLinkModel.php')
| -rw-r--r-- | app/Model/TaskLinkModel.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/Model/TaskLinkModel.php b/app/Model/TaskLinkModel.php index 45225e35..09978eae 100644 --- a/app/Model/TaskLinkModel.php +++ b/app/Model/TaskLinkModel.php @@ -29,6 +29,22 @@ class TaskLinkModel extends Base const EVENT_CREATE_UPDATE = 'tasklink.create_update'; /** + * Get projectId from $task_link_id + * + * @access public + * @param integer $task_link_id + * @return integer + */ + public function getProjectId($task_link_id) + { + return $this->db + ->table(self::TABLE) + ->eq(self::TABLE.'.id', $task_link_id) + ->join(TaskModel::TABLE, 'id', 'task_id') + ->findOneColumn(TaskModel::TABLE . '.project_id') ?: 0; + } + + /** * Get a task link * * @access public |
