/** * @return array */ protected function getSections() { if (!$this->sections) { $selection = $this->filterSections($this->sectionFacade->all()); if (!$this->user->getIdentity()->super) { $this->sectionFilter->filterId($selection, $this->user->getIdentity()->sections); } $this->sectionOrderer->order($selection, 'section'); if ($this->moduleGroup) { $selection->select('section.id, module.name'); $selection->group('section.module'); } else { $selection->select('section.id,section.name'); } $this->sections = $selection->fetchPairs('id', 'name'); } return $this->sections; }
/** * @return \Nette\Database\Table\Selection */ protected function allSections() { return $this->sectionOrderer->order($this->sectionFacade->all()); }