First API implementation

This commit is contained in:
Frédéric Guillot
2014-06-20 15:41:05 -03:00
parent efdc959c55
commit 7c5b900bd8
28 changed files with 1285 additions and 63 deletions

View File

@@ -108,6 +108,23 @@ class Task extends Base
}
}
/**
* Count all tasks for a given project and status
*
* @access public
* @param integer $project_id Project id
* @param array $status List of status id
* @return array
*/
public function getAll($project_id, array $status = array(self::STATUS_OPEN, self::STATUS_CLOSED))
{
return $this->db
->table(self::TABLE)
->eq('project_id', $project_id)
->in('is_active', $status)
->findAll();
}
/**
* Count all tasks for a given project and status
*