public function createDocument(
        array $properties,
        ObjectIdInterface $folderId = null,
        StreamInterface $contentStream = null,
        VersioningState $versioningState = null,
        array $policies = [],
        array $addAces = [],
        array $removeAces = []
    ) {
        if (empty($properties)) {
            throw new CmisInvalidArgumentException('Properties must not be empty!');
        }

        $objectId = $this->getBinding()->getObjectService()->createDocument(
            $this->getRepositoryId(),
            $this->getObjectFactory()->convertProperties(
                $properties,
                null,
                [],
                self::$createAndCheckoutUpdatability
            ),
            $folderId === null ? null : $folderId->getId(),
            $contentStream,
            $versioningState,
            $this->getObjectFactory()->convertPolicies($policies),
            $this->getObjectFactory()->convertAces($addAces),
            $this->getObjectFactory()->convertAces($removeAces),
            null
        );

        if ($objectId === null) {
            return null;
        }

        return $this->createObjectId($objectId);
    }
public function createDocument(
        array $properties,
        ObjectIdInterface $folderId = null,
        StreamInterface $contentStream = null,
        VersioningState $versioningState = null,
        array $policies = [],
        array $addAces = [],
        array $removeAces = []
    ) {
        if (empty($properties)) {
            throw new CmisInvalidArgumentException('Properties must not be empty!');
        }

        $objectId = $this->getBinding()->getObjectService()->createDocument(
            $this->getRepositoryId(),
            $this->getObjectFactory()->convertProperties(
                $properties,
                null,
                [],
                self::$createAndCheckoutUpdatability
            ),
            $folderId === null ? null : $folderId->getId(),
            $contentStream,
            $versioningState,
            $this->getObjectFactory()->convertPolicies($policies),
            $this->getObjectFactory()->convertAces($addAces),
            $this->getObjectFactory()->convertAces($removeAces),
            null
        );

        if ($objectId === null) {
            return null;
        }

        return $this->createObjectId($objectId);
    }
public function createDocument ( array $ properties , ObjectIdInterface $ folderId = null , StreamInterface $ contentStream = null , VersioningState $ versioningState = null , array $ policies = [ ] , array $ addAces = [ ] , array $ removeAces = [ ] ) { if ( empty ( $ properties ) ) { throw new CmisInvalidArgumentException ( 'Properties must not be empty!' ) ; } $ objectId = $ this -> getBinding ( ) -> getObjectService ( ) -> createDocument ( $ this -> getRepositoryId ( ) , $ this -> getObjectFactory ( ) -> convertProperties ( $ properties , null , [ ] , self :: $ createAndCheckoutUpdatability ) , $ folderId === null ? null : $ folderId -> getId ( ) , $ contentStream , $ versioningState , $ this -> getObjectFactory ( ) -> convertPolicies ( $ policies ) , $ this -> getObjectFactory ( ) -> convertAces ( $ addAces ) , $ this -> getObjectFactory ( ) -> convertAces ( $ removeAces ) , null ) ; if ( $ objectId === null ) { return null ; } return $ this -> createObjectId ( $ objectId ) ; }
Creates a new document. The stream in contentStream is consumed but not closed by this method.

@param string[] $properties The property values that MUST be applied to the newly-created document object.
@param ObjectIdInterface|null $folderId If specified, the identifier for the folder that MUST be the parent
folder for the newly-created document object. This parameter MUST be specified if the repository does NOT
support the optional "unfiling" capability.
@param StreamInterface|null $contentStream The content stream that MUST be stored for the newly-created document
object. The method of passing the contentStream to the server and the encoding mechanism will be specified
by each specific binding. MUST be required if the type requires it.
@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.
@return ObjectIdInterface|null the object ID of the new document or <code>null</code> if the document could not
be created.
@throws CmisInvalidArgumentException Throws an <code>CmisInvalidArgumentException</code> if empty
property list is given
Creates a new document . The stream in contentStream is consumed but not closed by this method .