/** * Load a news post by its ID * * @param int $id News ID * @return FALSE|\Nette\Database\Table\ActiveRow */ protected function loadItem($id) { $post = $this->news->get($id); if (!$post) { $this->flashMessage("Novinka s tímto id neexistuje"); $this->redirect('default'); } return $post; }