コード例 #1
0
ファイル: GroupController.php プロジェクト: ntoniazzi/PHPCI
 /**
  * List project groups.
  */
 public function index()
 {
     $this->requireAdmin();
     $groups = array();
     $groupList = $this->groupStore->getWhere(array(), 100, 0, array(), array('title' => 'ASC'));
     foreach ($groupList['items'] as $group) {
         $thisGroup = array('title' => $group->getTitle(), 'id' => $group->getId());
         $projects = b8\Store\Factory::getStore('Project')->getByGroupId($group->getId());
         $thisGroup['projects'] = $projects['items'];
         $groups[] = $thisGroup;
     }
     $this->view->groups = $groups;
 }
コード例 #2
0
 /**
  * Get a summary of the project groups we have, and what projects they have in them.
  * @return array
  */
 protected function getGroupInfo()
 {
     $rtn = array();
     $groups = $this->groupStore->getWhere(array(), 100, 0, array(), array('title' => 'ASC'));
     foreach ($groups['items'] as $group) {
         $thisGroup = array('title' => $group->getTitle());
         $projects = $this->projectStore->getByGroupId($group->getId());
         $thisGroup['projects'] = $projects['items'];
         $thisGroup['summary'] = $this->getSummaryHtml($thisGroup['projects']);
         $rtn[] = $thisGroup;
     }
     return $rtn;
 }