Exemplo n.º 1
0
 /**
  * @param int $articleId
  * @return void Odstraneni clanku
  */
 public function handleDeleteArticle($articleId)
 {
     $this->myArticle = $this->articleRepository->getById($articleId);
     if (!$this->myArticle) {
         $this->flashMessage($this->translator->translate('system.invalidId'));
         return;
     }
     $this->imageStorage->deleteArticleImage($this->myArticle);
     $result = $this->articleRepository->deleteArticle($this->myArticle);
     if ($result) {
         $this->flashMessage($this->translator->translate('system.requestS'), self::MESSAGE_SUCCESS);
     } else {
         $this->flashMessage($this->translator->translate('system.requestN'), self::MESSAGE_DANGER);
     }
     $this->redirect('this');
 }