Exemple #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;
     });
 }
Exemple #2
0
 protected function createComponentPost() : Post\Control
 {
     return $this->postControl->create($this->post ?: new Post\Entity());
 }