getConfig('type')) { $this->_getDataObj()->setFilter('showOnHomepage', 'y'); } else { $this->_getDataObj()->setFilter('showOnSponsors', 'y'); } $item = parent::_getListItem(); if (self::TYPE_HOMEPAGE == $this->getConfig('type')) { $item['tpl'] = $this->getTemplate('homePage.tpl'); } else { $this->groupList($item['list']); } return $item; } /** * @return void; */ private function groupList(&$list) { $newList = []; $lastGroupId = -1; foreach ($list as $row) { if ($lastGroupId != $row['groupId']) { $newList[$row['groupId']]['id'] = $row['groupId']; $newList[$row['groupId']]['title'] = $row['groupTitle']; $newList[$row['groupId']]['sponsors'] = []; $lastGroupId = $row['groupId']; } $newList[$row['groupId']]['sponsors'][] = $row; } $list = $newList; } }