Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php
public function publishWorkspaceAction(Workspace $workspace)
    {
        if (($targetWorkspace = $workspace->getBaseWorkspace()) === null) {
            $targetWorkspace = $this->workspaceRepository->findOneByName('live');
        }
        $this->publishingService->publishNodes($this->publishingService->getUnpublishedNodes($workspace), $targetWorkspace);
        $this->addFlashMessage($this->translator->translateById('workspaces.allChangesInWorkspaceHaveBeenPublished', [htmlspecialchars($workspace->getTitle()), htmlspecialchars($targetWorkspace->getTitle())], null, null, 'Modules', 'Neos.Neos'));
        $this->redirect('index');
    }
public function publishWorkspaceAction(Workspace $workspace)
    {
        if (($targetWorkspace = $workspace->getBaseWorkspace()) === null) {
            $targetWorkspace = $this->workspaceRepository->findOneByName('live');
        }
        $this->publishingService->publishNodes($this->publishingService->getUnpublishedNodes($workspace), $targetWorkspace);
        $this->addFlashMessage($this->translator->translateById('workspaces.allChangesInWorkspaceHaveBeenPublished', [htmlspecialchars($workspace->getTitle()), htmlspecialchars($targetWorkspace->getTitle())], null, null, 'Modules', 'Neos.Neos'));
        $this->redirect('index');
    }
public function publishWorkspaceAction ( Workspace $ workspace ) { if ( ( $ targetWorkspace = $ workspace -> getBaseWorkspace ( ) ) === null ) { $ targetWorkspace = $ this -> workspaceRepository -> findOneByName ( 'live' ) ; } $ this -> publishingService -> publishNodes ( $ this -> publishingService -> getUnpublishedNodes ( $ workspace ) , $ targetWorkspace ) ; $ this -> addFlashMessage ( $ this -> translator -> translateById ( 'workspaces.allChangesInWorkspaceHaveBeenPublished' , [ htmlspecialchars ( $ workspace -> getTitle ( ) ) , htmlspecialchars ( $ targetWorkspace -> getTitle ( ) ) ] , null , null , 'Modules' , 'Neos.Neos' ) ) ; $ this -> redirect ( 'index' ) ; }
Publishes the whole workspace

@param Workspace $workspace
@return void
Publishes the whole workspace