summaryrefslogtreecommitdiff
path: root/app/Model/TaskFinder.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-01-26 21:35:33 -0500
committerFrederic Guillot <fred@kanboard.net>2015-01-26 21:35:33 -0500
commit0f6a4e9de9b6fb1c07f1fd85bdd2786a5c21e3bd (patch)
tree83daa40ffb25d52aab3aaf8ba5c5e1429791c49e /app/Model/TaskFinder.php
parent29606b34cb5bce5c3cf656eb8acc137fb0836e76 (diff)
Allow urls without project_id
Diffstat (limited to 'app/Model/TaskFinder.php')
-rw-r--r--app/Model/TaskFinder.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/Model/TaskFinder.php b/app/Model/TaskFinder.php
index 6a19eeec..42f2f273 100644
--- a/app/Model/TaskFinder.php
+++ b/app/Model/TaskFinder.php
@@ -173,6 +173,18 @@ class TaskFinder extends Base
}
/**
+ * Get project id for a given task
+ *
+ * @access public
+ * @param integer $task_id Task id
+ * @return integer
+ */
+ public function getProjectId($task_id)
+ {
+ return (int) $this->db->table(Task::TABLE)->eq('id', $task_id)->findOneColumn('project_id') ?: 0;
+ }
+
+ /**
* Fetch a task by the id
*
* @access public