/** * @param int $id */ public function renderEdit($id = 0) { /** @var Form $form */ $form = $this['editForm']; if (!$form->isSubmitted()) { $item = $this->articlesRepository->get($id); $row = $this->articlesRepository->itemToArray($item); if (!$row) { throw new PDOException('Záznam nenalezen'); } $row['galleryIds'] = json_decode($row['galleryIds']); $form->setDefaults($row); $this->getTemplate()->picture = $item->pictureName(); } }