/** * Discards content of the whole workspace * * @param Workspace $workspace * @return void */ public function discardWorkspaceAction(Workspace $workspace) { $unpublishedNodes = $this->publishingService->getUnpublishedNodes($workspace); $this->publishingService->discardNodes($unpublishedNodes); $this->addFlashMessage($this->translator->translateById('workspaces.allChangesInWorkspaceHaveBeenDiscarded', [htmlspecialchars($workspace->getTitle())], null, null, 'Modules', 'TYPO3.Neos')); $this->redirect('index'); }
/** * Discards content of the whole workspace * * @param Workspace $workspace * @return void */ public function discardWorkspaceAction(Workspace $workspace) { $unpublishedNodes = $this->publishingService->getUnpublishedNodes($workspace); $this->publishingService->discardNodes($unpublishedNodes); $this->addFlashMessage('Changes in workspace "%s" have been discarded', 'Changes discarded', Message::SEVERITY_OK, array($workspace->getName()), 1412420835); $this->redirect('index'); }
/** * Discards the given nodes * * @param array<\TYPO3\TYPO3CR\Domain\Model\NodeInterface> $nodes * @return void */ public function discardNodesAction(array $nodes) { $this->publishingService->discardNodes($nodes); $this->throwStatus(204, 'Node changes have been discarded', ''); }