Example #1
0
 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;
     });
 }
Example #2
0
 protected function createComponentProduct() : Product\Control
 {
     return $this->productControl->create($this->product ?: new Product\Entity());
 }