Neos.ContentRepository/Classes/Domain/Service/PublishingService.php
public function publishNodes(array $nodes, Workspace $targetWorkspace = null)
    {
        $nodes = $this->sortNodesForPublishing($nodes);
        foreach ($nodes as $node) {
            $this->publishNode($node, $targetWorkspace);
        }
    }
public function publishNodes(array $nodes, Workspace $targetWorkspace = null)
    {
        $nodes = $this->sortNodesForPublishing($nodes);
        foreach ($nodes as $node) {
            $this->publishNode($node, $targetWorkspace);
        }
    }
public function publishNodes ( array $ nodes , Workspace $ targetWorkspace = null ) { $ nodes = $ this -> sortNodesForPublishing ( $ nodes ) ; foreach ( $ nodes as $ node ) { $ this -> publishNode ( $ node , $ targetWorkspace ) ; } }
Publishes the given nodes to the specified target workspace. If no workspace is specified, the source workspace's
base workspace is assumed.

@param array<\Neos\ContentRepository\Domain\Model\NodeInterface> $nodes The nodes to publish
@param Workspace $targetWorkspace If not set the base workspace is assumed to be the publishing target
@return void
@api
Publishes the given nodes to the specified target workspace . If no workspace is specified the source workspace s base workspace is assumed .