/** * Get a list of planning defined in a group_id * * @param User $user The user who will see the planning * @param int $group_id * * @return array of Planning */ public function getPlannings(User $user, $group_id) { $plannings = array(); foreach ($this->dao->searchPlannings($group_id) as $row) { $tracker = $this->tracker_factory->getTrackerById($row['planning_tracker_id']); if ($tracker && $tracker->userCanView($user)) { $plannings[] = new Planning($row['id'], $row['name'], $row['group_id'], $row['backlog_title'], $row['plan_title']); } } return $plannings; }
/** * Get a list of planning defined in a group_id * * @param PFUser $user The user who will see the planning * @param int $group_id * * @return Planning[] */ public function getPlannings(PFUser $user, $group_id) { $plannings = array(); foreach ($this->dao->searchPlannings($group_id) as $row) { $tracker = $this->tracker_factory->getTrackerById($row['planning_tracker_id']); if ($tracker && $tracker->userCanView($user)) { $plannings[] = $this->getPlanningFromRow($row); } } if ($plannings) { $this->sortPlanningsAccordinglyToHierarchy($plannings); } return $plannings; }