/** * @param int $id * @throws \Model\RecordNotFoundException */ public function load($id) { $record = $this->xxxFacade->all()->get($id); if (!$record) { throw new RecordNotFoundException(); } $this['form']['basic']->setDefaults($record); $this->xxxId = $id; }
/** * @return Grid */ protected function createGrid() { $selection = $this->xxxFacade->all(); $grid = $this->createPreparedGrid(); $grid->setModel($selection); $grid->addColumnText('id', '#')->setSortable()->setFilterNumber(); $grid->addActionHref('edit', 'Upravit')->setIcon('pencil')->getElementPrototype()->class = 'btn-dark-blue'; return $grid; }
/** * @return SelectBox */ public function create() { $items = $this->xxxFacade->all()->fetchPairs('id', 'name'); return new SelectBox('Label', $items); }