/** * @return \Nette\Database\Table\Selection */ protected function getData() { $selection = $this->sectionFacade->all(); if (!$this->user->getIdentity()->super) { $this->sectionFilter->filterId($selection, $this->user->getIdentity()->sections); } return $selection; }
/** * @return \Nette\Database\Table\Selection */ public function getUserSection() { $selection = $this->sectionFacade->all(); if (!$this->user->getIdentity()->super) { $this->sectionFilter->filterId($selection, $this->user->getIdentity()->sections); } return $selection; }
public function getData() { $selection = $this->sectionFacade->all(); if (!$this->user->getIdentity()->super) { $this->sectionFilter->filterId($selection, $this->user->getIdentity()->sections); } return $selection->fetchPairs('id', 'id'); }
/** * @param $id * @throws \Model\RecordNotFoundException */ public function load($id) { $section = $this->sectionFilter->filterId($this->sectionFacade->all(), $id)->fetch(); if (!$section) { throw new RecordNotFoundException("Section with ID {$id} does not exists!"); } $this->id = $id; $typeCodes = array_keys($this->sectionFacade->getMenuType($id)->fetchPairs('code')); $form = $this['form']; $form['base']->setDefaults($section->toArray()); $form['type']['menu_type_code']->setDefaultValue($typeCodes); }
public function load($id) { $context = $this->menuFacade->all()->select('menu.*, :menu_has_menu.parent.id AS id_menu'); $this->sectionFilter->filterId($context, $this->sectionId); $this->menuFilter->filterId($context, $id); $section = $context->fetch(); if (!$section) { throw new RecordNotFoundException("Menu with ID {$id} does not exists!"); } $this->id = $id; $sectionData = $section->toArray(); $form = $this['form']; $form['base']->setDefaults($sectionData); $form['parent']->setDefaults($sectionData); $this->lazyItemMap->get($section['type'])->load($id, $form['content']); }
/** * @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; }
/** * @param int $id * @return \Nette\Database\Table\Selection */ private function getPage($id) { $context = $this->pageFacade->all(); $this->sectionFilter->filterId($context, $this->sectionId); return $this->pageFilter->filterId($context, $id); }
/** * @param int $id * @return \Nette\Database\Table\Selection */ public function getMenuType($id) { $context = $this->menuTypeRepository->all(); return $this->sectionFilter->filterId($context, $id, ':section_has_menu_type'); }
/** * @return array */ public function getData() { $selection = $this->sectionFilter->filterId($this->competitionsFacade->all(), $this->sectionId, 'hosys_regions'); $this->competitionsOrderer->order($selection, 'competitions'); return $selection->fetchPairs('id', 'jmeno'); }
/** * @param int $id * @return array */ public function getOptionsBySection($id) { $context = $this->presenterFacade->all(); $this->sectionFilter->filterId($context, $id, ':module_has_presenter.module', ':'); return $context->order('name')->fetchPairs('code', 'name'); }
/** * @param $module * @return \Nette\Database\Table\Selection */ public function sectionModule($module) { $selection = $this->all(); $this->sectionFilter->filterModule($selection, $module); return $selection; }