Neos\Neos\Ui\Controller\BackendServiceController::discardAction PHP Метод

discardAction() публичный Метод

Discard nodes
public discardAction ( array $nodeContextPaths ) : void
$nodeContextPaths array
Результат void
    public function discardAction(array $nodeContextPaths)
    {
        try {
            foreach ($nodeContextPaths as $contextPath) {
                $node = $this->nodeService->getNodeFromContextPath($contextPath);
                $this->publishingService->discardNode($node);
                $reloadDocument = new ReloadDocument();
                $reloadDocument->setDocument($this->nodeService->getClosestDocument($node));
                $this->feedbackCollection->add($reloadDocument);
            }
            $success = new Success();
            $success->setMessage(sprintf('Discarded %d node(s).', count($nodeContextPaths)));
            $this->updateWorkspaceInfo($nodeContextPaths[0]);
            $this->feedbackCollection->add($success);
            $this->persistenceManager->persistAll();
        } catch (\Exception $e) {
            $error = new Error();
            $error->setMessage($e->getMessage());
            $this->feedbackCollection->add($error);
        }
        $this->view->assign('value', $this->feedbackCollection);
    }