Neos\Neos\Service\Controller\WorkspaceController::publishAllAction PHP Method

publishAllAction() public method

Publish everything in the workspace with the given workspace name
public publishAllAction ( string $sourceWorkspaceName, string $targetWorkspaceName ) : void
$sourceWorkspaceName string Name of the source workspace containing the content to publish
$targetWorkspaceName string Name of the target workspace the content should be published to
return void
    public function publishAllAction($sourceWorkspaceName, $targetWorkspaceName)
    {
        $sourceWorkspace = $this->workspaceRepository->findOneByName($sourceWorkspaceName);
        $targetWorkspace = $this->workspaceRepository->findOneByName($targetWorkspaceName);
        if ($sourceWorkspace === null) {
            $this->throwStatus(400, 'Invalid source workspace');
        }
        if ($targetWorkspace === null) {
            $this->throwStatus(400, 'Invalid target workspace');
        }
        $this->publishingService->publishNodes($this->publishingService->getUnpublishedNodes($sourceWorkspace), $targetWorkspace);
        $this->throwStatus(204, sprintf('All changes in workspace %s have been published to %s', $sourceWorkspaceName, $targetWorkspaceName), '');
    }