Neos\ContentRepository\Domain\Service\PublishingService::publishNodes PHP Method

publishNodes() public method

Publishes the given nodes to the specified target workspace. If no workspace is specified, the source workspace's base workspace is assumed.
public publishNodes ( array $nodes, Workspace $targetWorkspace = null ) : void
$nodes array
$targetWorkspace Neos\ContentRepository\Domain\Model\Workspace If not set the base workspace is assumed to be the publishing target
return void
    public function publishNodes(array $nodes, Workspace $targetWorkspace = null)
    {
        $nodes = $this->sortNodesForPublishing($nodes);
        foreach ($nodes as $node) {
            $this->publishNode($node, $targetWorkspace);
        }
    }