Refactoring/simplification of the pull-request about links

This commit is contained in:
Frederic Guillot
2015-02-14 16:11:13 -05:00
parent 364382b1b5
commit f7e4c3928a
77 changed files with 1407 additions and 2588 deletions

View File

@@ -337,6 +337,23 @@ class ProjectPermission extends Base
->findAllByColumn('projects.id');
}
/**
* Return a list of active project ids where the user is member
*
* @access public
* @param integer $user_id User id
* @return []integer
*/
public function getActiveMemberProjectIds($user_id)
{
return $this->db
->table(Project::TABLE)
->eq('user_id', $user_id)
->eq(Project::TABLE.'.is_active', Project::ACTIVE)
->join(self::TABLE, 'project_id', 'id')
->findAllByColumn('projects.id');
}
/**
* Return a list of active projects where the user is member
*