protected function createComponentProduct() : Nette\Application\UI\Multiplier { return new Nette\Application\UI\Multiplier(function ($id) : Ytnuk\Shop\Product\Control { $entity = $this->productRepository->getById($id); if ($entity instanceof Ytnuk\Shop\Product\Entity) { return $this->productControl->create($entity); } return NULL; }); }
public function actionEdit(int $id) { if (!($this->entity = $this->repository->getById($id))) { $this->error(); } }