public function copy(
        ObjectIdInterface $targetFolderId = null,
        array $properties = [],
        VersioningState $versioningState = null,
        array $policies = [],
        array $addAces = [],
        array $removeAces = [],
        OperationContextInterface $context = null
    ) {
        try {
            $newObjectId = $this->getSession()->createDocumentFromSource(
                $this,
                $properties,
                $targetFolderId,
                $versioningState,
                $policies,
                $addAces,
                $removeAces
            );
        } catch (CmisNotSupportedException $notSupportedException) {
            $newObjectId = $this->copyViaClient(
                $targetFolderId,
                $properties,
                $versioningState,
                $policies,
                $addAces,
                $removeAces
            );
        }

        $document = $this->getNewlyCreatedObject($newObjectId, $context);

        if ($document === null) {
            return null;
        } elseif (!$document instanceof DocumentInterface) {
            throw new CmisRuntimeException('Newly created object is not a document! New id: ' . $document->getId());
        }

        return $document;
    }
public function copy(
        ObjectIdInterface $targetFolderId = null,
        array $properties = [],
        VersioningState $versioningState = null,
        array $policies = [],
        array $addAces = [],
        array $removeAces = [],
        OperationContextInterface $context = null
    ) {
        try {
            $newObjectId = $this->getSession()->createDocumentFromSource(
                $this,
                $properties,
                $targetFolderId,
                $versioningState,
                $policies,
                $addAces,
                $removeAces
            );
        } catch (CmisNotSupportedException $notSupportedException) {
            $newObjectId = $this->copyViaClient(
                $targetFolderId,
                $properties,
                $versioningState,
                $policies,
                $addAces,
                $removeAces
            );
        }

        $document = $this->getNewlyCreatedObject($newObjectId, $context);

        if ($document === null) {
            return null;
        } elseif (!$document instanceof DocumentInterface) {
            throw new CmisRuntimeException('Newly created object is not a document! New id: ' . $document->getId());
        }

        return $document;
    }
public function copy ( ObjectIdInterface $ targetFolderId = null , array $ properties = [ ] , VersioningState $ versioningState = null , array $ policies = [ ] , array $ addAces = [ ] , array $ removeAces = [ ] , OperationContextInterface $ context = null ) { try { $ newObjectId = $ this -> getSession ( ) -> createDocumentFromSource ( $ this , $ properties , $ targetFolderId , $ versioningState , $ policies , $ addAces , $ removeAces ) ; } catch ( CmisNotSupportedException $ notSupportedException ) { $ newObjectId = $ this -> copyViaClient ( $ targetFolderId , $ properties , $ versioningState , $ policies , $ addAces , $ removeAces ) ; } $ document = $ this -> getNewlyCreatedObject ( $ newObjectId , $ context ) ; if ( $ document === null ) { return null ; } elseif ( ! $ document instanceof DocumentInterface ) { throw new CmisRuntimeException ( 'Newly created object is not a document! New id: ' . $ document -> getId ( ) ) ; } return $ document ; }
Creates a copy of this document, including content.

@param ObjectIdInterface|null $targetFolderId the ID of the target folder, <code>null</code> to create an unfiled
document
@param array $properties The property values that MUST be applied to the object. This list of properties SHOULD
only contain properties whose values differ from the source document. The array key is the property name
the value is the property value.
@param VersioningState|null $versioningState An enumeration specifying what the versioning state of the
newly-created object MUST be. Valid values are:
<code>none</code>
(default, if the object-type is not versionable) The document MUST be created as a non-versionable
document.
<code>checkedout</code>
The document MUST be created in the checked-out state. The checked-out document MAY be
visible to other users.
<code>major</code>
(default, if the object-type is versionable) The document MUST be created as a major version.
<code>minor</code>
The document MUST be created as a minor version.
@param PolicyInterface[] $policies A list of policy ids that MUST be applied to the newly-created document
object.
@param AceInterface[] $addAces A list of ACEs that MUST be added to the newly-created document object, either
using the ACL from folderId if specified, or being applied if no folderId is specified.
@param AceInterface[] $removeAces A list of ACEs that MUST be removed from the newly-created document object,
either using the ACL from folderId if specified, or being ignored if no folderId is specified.
@param OperationContextInterface|null $context
@return DocumentInterface the new document object or <code>null</code> if the parameter <code>context</code> was
set to <code>null</code>
@throws CmisRuntimeException Exception is thrown if the created object is not a document
Creates a copy of this document including content .