From e8228c3975bb7cf2179d2ba670aa55d3e7780f3c Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Fri, 18 Sep 2015 22:37:00 -0400 Subject: Add some tests --- app/Model/Project.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'app/Model/Project.php') 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(); } -- cgit v1.2.3