public function updateProperties(array $properties, $refresh = true)
    {
        if (empty($properties)) {
            throw new CmisInvalidArgumentException('Properties must not be empty!');
        }

        $objectId = $this->getId();
        $changeToken = $this->getChangeToken();

        $updatability = [];
        $updatability[] = Updatability::cast(Updatability::READWRITE);
        if ((boolean) $this->getPropertyValue(PropertyIds::IS_VERSION_SERIES_CHECKED_OUT) === true) {
            $updatability[] = Updatability::cast(Updatability::WHENCHECKEDOUT);
        }

        $newObjectId = $objectId;
        $this->getBinding()->getObjectService()->updateProperties(
            $this->getRepositoryId(),
            $newObjectId,
            $this->getObjectFactory()->convertProperties(
                $properties,
                $this->getObjectType(),
                (array) $this->getSecondaryTypes(),
                $updatability
            ),
            $changeToken
        );

        // remove the object from the cache, it has been changed
        $this->getSession()->removeObjectFromCache($this->getSession()->createObjectId($objectId));

        if ($refresh === true) {
            $this->refresh();
        }

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

        return $this->getSession()->getObject(
            $this->getSession()->createObjectId($newObjectId),
            $this->getCreationContext()
        );
    }
public function updateProperties(array $properties, $refresh = true)
    {
        if (empty($properties)) {
            throw new CmisInvalidArgumentException('Properties must not be empty!');
        }

        $objectId = $this->getId();
        $changeToken = $this->getChangeToken();

        $updatability = [];
        $updatability[] = Updatability::cast(Updatability::READWRITE);
        if ((boolean) $this->getPropertyValue(PropertyIds::IS_VERSION_SERIES_CHECKED_OUT) === true) {
            $updatability[] = Updatability::cast(Updatability::WHENCHECKEDOUT);
        }

        $newObjectId = $objectId;
        $this->getBinding()->getObjectService()->updateProperties(
            $this->getRepositoryId(),
            $newObjectId,
            $this->getObjectFactory()->convertProperties(
                $properties,
                $this->getObjectType(),
                (array) $this->getSecondaryTypes(),
                $updatability
            ),
            $changeToken
        );

        // remove the object from the cache, it has been changed
        $this->getSession()->removeObjectFromCache($this->getSession()->createObjectId($objectId));

        if ($refresh === true) {
            $this->refresh();
        }

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

        return $this->getSession()->getObject(
            $this->getSession()->createObjectId($newObjectId),
            $this->getCreationContext()
        );
    }
public function updateProperties ( array $ properties , $ refresh = true ) { if ( empty ( $ properties ) ) { throw new CmisInvalidArgumentException ( 'Properties must not be empty!' ) ; } $ objectId = $ this -> getId ( ) ; $ changeToken = $ this -> getChangeToken ( ) ; $ updatability = [ ] ; $ updatability [ ] = Updatability :: cast ( Updatability :: READWRITE ) ; if ( ( boolean ) $ this -> getPropertyValue ( PropertyIds :: IS_VERSION_SERIES_CHECKED_OUT ) === true ) { $ updatability [ ] = Updatability :: cast ( Updatability :: WHENCHECKEDOUT ) ; } $ newObjectId = $ objectId ; $ this -> getBinding ( ) -> getObjectService ( ) -> updateProperties ( $ this -> getRepositoryId ( ) , $ newObjectId , $ this -> getObjectFactory ( ) -> convertProperties ( $ properties , $ this -> getObjectType ( ) , ( array ) $ this -> getSecondaryTypes ( ) , $ updatability ) , $ changeToken ) ; // remove the object from the cache, it has been changed $ this -> getSession ( ) -> removeObjectFromCache ( $ this -> getSession ( ) -> createObjectId ( $ objectId ) ) ; if ( $ refresh === true ) { $ this -> refresh ( ) ; } if ( $ newObjectId === null ) { return null ; } return $ this -> getSession ( ) -> getObject ( $ this -> getSession ( ) -> createObjectId ( $ newObjectId ) , $ this -> getCreationContext ( ) ) ; }
Updates the provided properties. If the repository created a new object, for example a new version,
the object ID of the new object is returned. Otherwise the object ID of the current object is returned.

@param mixed[] $properties the properties to update
@param boolean $refresh <code>true</code> if this object should be refresh after the update,
<code>false</code> if not
@return CmisObjectInterface|null the object ID of the updated object - can return <code>null</code> in case
of a repository failure
Updates the provided properties . If the repository created a new object for example a new version the object ID of the new object is returned . Otherwise the object ID of the current object is returned .