summaryrefslogtreecommitdiff
path: root/app/Model/TaskLinkModel.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Model/TaskLinkModel.php')
-rw-r--r--app/Model/TaskLinkModel.php16
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