Improve task duplication

This commit is contained in:
Frédéric Guillot
2014-09-01 20:40:02 -08:00
parent e6d0658a0e
commit 457e181ffb
17 changed files with 137 additions and 79 deletions

View File

@@ -20,6 +20,19 @@ class Category extends Base
*/
const TABLE = 'project_has_categories';
/**
* Return true if a category exists for a given project
*
* @access public
* @param integer $category_id Category id
* @param integer $project_id Project id
* @return boolean
*/
public function exists($category_id, $project_id)
{
return $this->db->table(self::TABLE)->eq('id', $category_id)->eq('project_id', $project_id)->count() > 0;
}
/**
* Get a category by the id
*