コード例 #1
0
 /**
  * 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');
 }
コード例 #2
0
ファイル: WorkspaceController.php プロジェクト: neos/neos
 /**
  * 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', '');
 }