Ejemplo n.º 1
0
 /**
  * @param Form $form
  */
 public function formSucceeded(Form $form)
 {
     $values = $form->getValues();
     /** @var GalleriesEntity $galleries */
     $galleries = $this->galleriesRepository->get($values->id);
     $galleries->name($values->name);
     $galleries->description($values->description);
     $galleries->url(Strings::webalize($values->name));
     $this->galleriesRepository->save($galleries);
 }
Ejemplo n.º 2
0
 /**
  * @param int $id
  */
 public function renderEdit($id = 0)
 {
     /** @var Form $form */
     $form = $this['editForm'];
     $this->getTemplate()->id = $id;
     if (!$form->isSubmitted()) {
         $item = $this->galleriesRepository->get($id);
         $row = $this->galleriesRepository->itemToArray($item);
         if (!$row) {
             throw new PDOException('Záznam nenalezen');
         }
         $form->setDefaults($row);
     }
 }