public function ulozitRubriku(Rubrika $rubrika) { if ($rubrika->id) { $zaznam = $this->getTable()->where('id', $rubrika->id)->update($rubrika->getUdaje()); } else { $zaznam = $this->getTable()->insert($rubrika->getUdaje()); } return $zaznam; }
public function editRubrikaFormSubmitted(UpravitRubrikuForm $form) { $this->overitRubriku($this->id); $this->opravneni = $this->opravneni($this->id); if (!$this->opravneni['rubrika_edit']) { $this->redirect('rubriky', $this->id); } $values = $form->getValues(); $rubrika = new Rubrika($this->id); $rubrika->setUdaje($values); $zaznam = $this->redakce->ulozitRubriku($rubrika); $this->logg("upravena rubrika " . $this->id); $this->flashMessage('Změny byly uloženy.'); $this->redirect('rubriky', $this->id); }