protected function createComponentPost() : Nette\Application\UI\Multiplier { return new Nette\Application\UI\Multiplier(function ($id) : Ytnuk\Blog\Post\Control { $entity = $this->postRepository->getById($id); if ($entity instanceof Ytnuk\Blog\Post\Entity) { return $this->postControl->create($entity); } return NULL; }); }
public function actionEdit(int $id) { if (!($this->entity = $this->repository->getById($id))) { $this->error(); } }