diff options
| author | Frederic Guillot <fred@kanboard.net> | 2015-01-26 21:35:33 -0500 |
|---|---|---|
| committer | Frederic Guillot <fred@kanboard.net> | 2015-01-26 21:35:33 -0500 |
| commit | 0f6a4e9de9b6fb1c07f1fd85bdd2786a5c21e3bd (patch) | |
| tree | 83daa40ffb25d52aab3aaf8ba5c5e1429791c49e /app/Model/TaskFinder.php | |
| parent | 29606b34cb5bce5c3cf656eb8acc137fb0836e76 (diff) | |
Allow urls without project_id
Diffstat (limited to 'app/Model/TaskFinder.php')
| -rw-r--r-- | app/Model/TaskFinder.php | 12 |
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 |
