Allow urls without project_id

This commit is contained in:
Frederic Guillot
2015-01-26 21:35:33 -05:00
parent 29606b34cb
commit 0f6a4e9de9
2 changed files with 34 additions and 5 deletions

View File

@@ -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
*