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

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

Publish nodes
public publishAction ( array $nodeContextPaths, string $targetWorkspaceName ) : void
$nodeContextPaths array
$targetWorkspaceName string
Результат void
    public function publishAction(array $nodeContextPaths, $targetWorkspaceName)
    {
        try {
            $targetWorkspace = $this->workspaceRepository->findOneByName($targetWorkspaceName);
            foreach ($nodeContextPaths as $contextPath) {
                $node = $this->nodeService->getNodeFromContextPath($contextPath);
                $this->publishingService->publishNode($node, $targetWorkspace);
            }
            $success = new Success();
            $success->setMessage(sprintf('Published %d change(s) to %s.', count($nodeContextPaths), $targetWorkspaceName));
            $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);
    }