public function propPatch($url, array $properties)
    {
        $propPatch = new Xml\Request\PropPatch();
        $propPatch->properties = $properties;
        $xml = $this->xml->write(
            '{DAV:}propertyupdate',
            $propPatch
        );

        $url = $this->getAbsoluteUrl($url);
        $request = new HTTP\Request('PROPPATCH', $url, [
            'Content-Type' => 'application/xml',
        ], $xml);
        $response = $this->send($request);

        if ($response->getStatus() >= 400) {
            throw new HTTP\ClientHttpException($response);
        }

        if (207 === $response->getStatus()) {
            // If it's a 207, the request could still have failed, but the
            // information is hidden in the response body.
            $result = $this->parseMultiStatus($response->getBodyAsString());

            $errorProperties = [];
            foreach ($result as $href => $statusList) {
                foreach ($statusList as $status => $properties) {
                    if ($status >= 400) {
                        foreach ($properties as $propName => $propValue) {
                            $errorProperties[] = $propName.' ('.$status.')';
                        }
                    }
                }
            }
            if ($errorProperties) {
                throw new HTTP\ClientException('PROPPATCH failed. The following properties errored: '.implode(', ', $errorProperties));
            }
        }

        return true;
    }
public function propPatch($url, array $properties)
    {
        $propPatch = new Xml\Request\PropPatch();
        $propPatch->properties = $properties;
        $xml = $this->xml->write(
            '{DAV:}propertyupdate',
            $propPatch
        );

        $url = $this->getAbsoluteUrl($url);
        $request = new HTTP\Request('PROPPATCH', $url, [
            'Content-Type' => 'application/xml',
        ], $xml);
        $response = $this->send($request);

        if ($response->getStatus() >= 400) {
            throw new HTTP\ClientHttpException($response);
        }

        if (207 === $response->getStatus()) {
            // If it's a 207, the request could still have failed, but the
            // information is hidden in the response body.
            $result = $this->parseMultiStatus($response->getBodyAsString());

            $errorProperties = [];
            foreach ($result as $href => $statusList) {
                foreach ($statusList as $status => $properties) {
                    if ($status >= 400) {
                        foreach ($properties as $propName => $propValue) {
                            $errorProperties[] = $propName.' ('.$status.')';
                        }
                    }
                }
            }
            if ($errorProperties) {
                throw new HTTP\ClientException('PROPPATCH failed. The following properties errored: '.implode(', ', $errorProperties));
            }
        }

        return true;
    }
public function propPatch ( $ url , array $ properties ) { $ propPatch = new Xml \ Request \ PropPatch ( ) ; $ propPatch -> properties = $ properties ; $ xml = $ this -> xml -> write ( '{DAV:}propertyupdate' , $ propPatch ) ; $ url = $ this -> getAbsoluteUrl ( $ url ) ; $ request = new HTTP \ Request ( 'PROPPATCH' , $ url , [ 'Content-Type' => 'application/xml' , ] , $ xml ) ; $ response = $ this -> send ( $ request ) ; if ( $ response -> getStatus ( ) >= 400 ) { throw new HTTP \ ClientHttpException ( $ response ) ; } if ( 207 === $ response -> getStatus ( ) ) { // If it's a 207, the request could still have failed, but the // information is hidden in the response body. $ result = $ this -> parseMultiStatus ( $ response -> getBodyAsString ( ) ) ; $ errorProperties = [ ] ; foreach ( $ result as $ href => $ statusList ) { foreach ( $ statusList as $ status => $ properties ) { if ( $ status >= 400 ) { foreach ( $ properties as $ propName => $ propValue ) { $ errorProperties [ ] = $ propName . ' (' . $ status . ')' ; } } } } if ( $ errorProperties ) { throw new HTTP \ ClientException ( 'PROPPATCH failed. The following properties errored: ' . implode ( ', ' , $ errorProperties ) ) ; } } return true ; }
Updates a list of properties on the server.

The list of properties must have clark-notation properties for the keys,
and the actual (string) value for the value. If the value is null, an
attempt is made to delete the property.

@param string $url
@param array  $properties

@return bool
Updates a list of properties on the server .