/** * Removes the asset of news * * @param string $newsId * @param string $linkId * @return void */ public function removeRelatedLinkAction($newsId, $linkId) { try { $link = $this->linkService->findById($linkId); $news = $this->newsService->findById($newsId); $this->newsService->removeRelatedLink($link, $news); echo json_encode(1); exit; } catch (Lelesys\Plugin\News\Domain\Service\Exception $exception) { $packageKey = $this->settings['flashMessage']['packageKey']; $header = 'Sorry, error occured. Please try again later.'; $message = $this->translator->translateById('lelesys.plugin.news.try.again', array(), NULL, NULL, 'Main', $packageKey); $this->addFlashMessage($message, $header, \TYPO3\Flow\Error\Message::SEVERITY_ERROR); } }