Jackalope\ObjectManager::copyNodeImmediately PHP Method

copyNodeImmediately() public method

Implement the workspace copy method. It is dispatched immediately.
See also: Workspace::copy()
public copyNodeImmediately ( string $srcAbsPath, string $destAbsPath, string $srcWorkspace )
$srcAbsPath string the path of the node to be copied.
$destAbsPath string the location to which the node at srcAbsPath is to be copied in this workspace.
$srcWorkspace string the name of the workspace from which the copy is to be made.
    public function copyNodeImmediately($srcAbsPath, $destAbsPath, $srcWorkspace)
    {
        if (!$this->transport instanceof WritingInterface) {
            throw new UnsupportedRepositoryOperationException('Transport does not support writing');
        }
        $srcAbsPath = PathHelper::normalizePath($srcAbsPath);
        $destAbsPath = PathHelper::normalizePath($destAbsPath, true);
        if ($this->session->nodeExists($destAbsPath)) {
            throw new ItemExistsException('Node already exists at destination (update-on-copy is currently not supported)');
            // to support this, we would have to update the local cache of nodes as well
        }
        $this->transport->copyNode($srcAbsPath, $destAbsPath, $srcWorkspace);
    }