Neos\ContentRepository\Domain\Repository\NodeDataRepository::collectWorkspaceAndAllBaseWorkspaces PHP Method

collectWorkspaceAndAllBaseWorkspaces() protected method

Returns an array that contains the given workspace and all base (parent) workspaces of it.
protected collectWorkspaceAndAllBaseWorkspaces ( Workspace $workspace ) : array
$workspace Neos\ContentRepository\Domain\Model\Workspace
return array
    protected function collectWorkspaceAndAllBaseWorkspaces(Workspace $workspace)
    {
        $workspaces = [];
        while ($workspace !== null) {
            $workspaces[] = $workspace;
            $workspace = $workspace->getBaseWorkspace();
        }
        return $workspaces;
    }