Example #1
0
 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;
     });
 }
Example #2
0
 public function actionEdit(int $id)
 {
     if (!($this->entity = $this->repository->getById($id))) {
         $this->error();
     }
 }