/** * 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', 'Neos.Neos')); $this->redirect('index'); }
/** * Discards the given nodes * * @param array<\Neos\ContentRepository\Domain\Model\NodeInterface> $nodes * @return void */ public function discardNodesAction(array $nodes) { $this->publishingService->discardNodes($nodes); $this->throwStatus(204, 'Node changes have been discarded', ''); }