private function pickRefill()
 {
     $detail = $this->getParam('detail');
     $arr = ['type' => 'none'];
     switch ($detail) {
         default:
             return null;
         case 'udalost':
             $arr['type'] = 'evt';
             $arr['evt'] = Tables\Event::fromPOST();
             break;
         case 'rezervace':
             $arr['type'] = 'res';
             $arr['res'] = Tables\Reservation::fromPOST();
             break;
     }
     return $arr;
 }
 public function doUlozit()
 {
     $event = Tables\Event::fromPOST();
     $event->author_user_id = $this->user->user_id;
     if (!$event->readyForInsert()) {
         $this->message->warning('Pole události nebyla vyplněna správně, tato obsahovala chyby: ' . implode(", ", array_keys($event->misc['missing'])));
         $this->redirectPars('udalost', 'upravit', ['id' => $event->event_id]);
     }
     $values = $event->asArray();
     $id = $event->event_id;
     unset($values['event_id']);
     if (Tables\Event::update($this->pdo, $values, $id)) {
         $this->message->success("Událost byla úspěšně upravena");
     } else {
         $this->message->danger("Při ukládání úprav nastala neočekávaná chyba");
     }
     $this->redirectPars("udalost", "zobrazit", ['id' => $id]);
 }