diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-09-18 22:37:00 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-09-18 22:37:00 -0400 |
commit | e8228c3975bb7cf2179d2ba670aa55d3e7780f3c (patch) | |
tree | 8f5ce7b8fd5c465b2dc4f1128fc82be93665f919 /app/Model/Project.php | |
parent | 1fa72295f20aa9794f1b33dfde95960c34d85366 (diff) |
Add some tests
Diffstat (limited to 'app/Model/Project.php')
-rw-r--r-- | app/Model/Project.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/Model/Project.php b/app/Model/Project.php index 6e4cfcfd..8ddcc443 100644 --- a/app/Model/Project.php +++ b/app/Model/Project.php @@ -172,16 +172,20 @@ class Project extends Base { return $this->db->table(self::TABLE)->asc('name')->findAll(); } - + /** * Get all projects with given Ids * * @access public - * @param integer[] $project_ids Projects id + * @param integer[] $project_ids * @return array */ - public function getAllByIds($project_ids) + public function getAllByIds(array $project_ids) { + if (empty($project_ids)) { + return array(); + } + return $this->db->table(self::TABLE)->in('id', $project_ids)->asc('name')->findAll(); } |