Neos\ContentRepository\Domain\Model\Workspace::verifyPublishingTargetWorkspace PHP Method

verifyPublishingTargetWorkspace() protected method

Checks if the specified workspace is a base workspace of this workspace and if not, throws an exception
protected verifyPublishingTargetWorkspace ( Workspace $targetWorkspace ) : void
$targetWorkspace Workspace The publishing target workspace
return void
    protected function verifyPublishingTargetWorkspace(Workspace $targetWorkspace)
    {
        $baseWorkspace = $this;
        while ($baseWorkspace === null || $targetWorkspace->getName() !== $baseWorkspace->getName()) {
            if ($baseWorkspace === null) {
                throw new WorkspaceException(sprintf('The specified workspace "%s" is not a base workspace of "%s".', $targetWorkspace->getName(), $this->getName()), 1289499117);
            }
            $baseWorkspace = $baseWorkspace->getBaseWorkspace();
        }
    }