From 0f6a4e9de9b6fb1c07f1fd85bdd2786a5c21e3bd Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Mon, 26 Jan 2015 21:35:33 -0500 Subject: Allow urls without project_id --- app/Model/TaskFinder.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'app/Model/TaskFinder.php') 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 @@ -172,6 +172,18 @@ class TaskFinder extends Base return $tasks; } + /** + * 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 * -- cgit v1.2.3