summaryrefslogtreecommitdiff
path: root/app/Model/Project.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Model/Project.php')
-rw-r--r--app/Model/Project.php37
1 files changed, 37 insertions, 0 deletions
diff --git a/app/Model/Project.php b/app/Model/Project.php
index 3c864e5d..fedc41ac 100644
--- a/app/Model/Project.php
+++ b/app/Model/Project.php
@@ -261,6 +261,24 @@ class Project extends Base
}
/**
+ * Fetch more information for each project
+ *
+ * @access public
+ * @param array $projects
+ * @return array
+ */
+ public function applyProjectDetails(array $projects)
+ {
+ foreach ($projects as &$project) {
+ $this->getColumnStats($project);
+ $project['managers'] = $this->projectPermission->getManagers($project['id']);
+ $project['members'] = $this->projectPermission->getOnlyMembers($project['id']);
+ }
+
+ return $projects;
+ }
+
+ /**
* Get project summary for a list of project
*
* @access public
@@ -280,6 +298,25 @@ class Project extends Base
}
/**
+ * Get project details (users + columns) for a list of project
+ *
+ * @access public
+ * @param array $project_ids List of project id
+ * @return \PicoDb\Table
+ */
+ public function getQueryProjectDetails(array $project_ids)
+ {
+ if (empty($project_ids)) {
+ return $this->db->table(Project::TABLE)->limit(0);
+ }
+
+ return $this->db
+ ->table(Project::TABLE)
+ ->in('id', $project_ids)
+ ->callback(array($this, 'applyProjectDetails'));
+ }
+
+ /**
* Create a project
*
* @access public