From 9a98013736f1acebbb62c5fce6a10c02e32b516f Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 31 Jan 2015 11:21:43 -0500 Subject: Add table/pagination to the project list --- app/Model/ProjectPermission.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'app/Model/ProjectPermission.php') diff --git a/app/Model/ProjectPermission.php b/app/Model/ProjectPermission.php index 352677d9..fb6316b6 100644 --- a/app/Model/ProjectPermission.php +++ b/app/Model/ProjectPermission.php @@ -321,6 +321,22 @@ class ProjectPermission extends Base ->getAll('projects.id', 'name'); } + /** + * Return a list of project ids where the user is member + * + * @access public + * @param integer $user_id User id + * @return []integer + */ + public function getMemberProjectIds($user_id) + { + return $this->db + ->table(Project::TABLE) + ->eq('user_id', $user_id) + ->join(self::TABLE, 'project_id', 'id') + ->findAllByColumn('projects.id'); + } + /** * Return a list of active projects where the user is member * -- cgit v1.2.3