xref: /plugin/davcal/vendor/sabre/dav/lib/DAV/Exception/InvalidSyncToken.php (revision a1a3b6794e0e143a4a8b51d3185ce2d339be61ab)
1*a1a3b679SAndreas Boehler<?php
2*a1a3b679SAndreas Boehler
3*a1a3b679SAndreas Boehlernamespace Sabre\DAV\Exception;
4*a1a3b679SAndreas Boehler
5*a1a3b679SAndreas Boehleruse Sabre\DAV;
6*a1a3b679SAndreas Boehler
7*a1a3b679SAndreas Boehler/**
8*a1a3b679SAndreas Boehler * InvalidSyncToken
9*a1a3b679SAndreas Boehler *
10*a1a3b679SAndreas Boehler * This exception is emited for the {DAV:}valid-sync-token pre-condition, as
11*a1a3b679SAndreas Boehler * defined in rfc6578, section 3.2.
12*a1a3b679SAndreas Boehler *
13*a1a3b679SAndreas Boehler * http://tools.ietf.org/html/rfc6578#section-3.2
14*a1a3b679SAndreas Boehler *
15*a1a3b679SAndreas Boehler * This is emitted in cases where the the sync-token, supplied by a client is
16*a1a3b679SAndreas Boehler * either completely unknown, or has expired.
17*a1a3b679SAndreas Boehler *
18*a1a3b679SAndreas Boehler * @author Evert Pot (http://evertpot.com/)
19*a1a3b679SAndreas Boehler * @copyright Copyright (C) 2007-2015 fruux GmbH (https://fruux.com/).
20*a1a3b679SAndreas Boehler * @license http://sabre.io/license/ Modified BSD License
21*a1a3b679SAndreas Boehler */
22*a1a3b679SAndreas Boehlerclass InvalidSyncToken extends Forbidden {
23*a1a3b679SAndreas Boehler
24*a1a3b679SAndreas Boehler    /**
25*a1a3b679SAndreas Boehler     * This method allows the exception to include additional information into the WebDAV error response
26*a1a3b679SAndreas Boehler     *
27*a1a3b679SAndreas Boehler     * @param DAV\Server $server
28*a1a3b679SAndreas Boehler     * @param \DOMElement $errorNode
29*a1a3b679SAndreas Boehler     * @return void
30*a1a3b679SAndreas Boehler     */
31*a1a3b679SAndreas Boehler    function serialize(DAV\Server $server, \DOMElement $errorNode) {
32*a1a3b679SAndreas Boehler
33*a1a3b679SAndreas Boehler        $error = $errorNode->ownerDocument->createElementNS('DAV:', 'd:valid-sync-token');
34*a1a3b679SAndreas Boehler        $errorNode->appendChild($error);
35*a1a3b679SAndreas Boehler
36*a1a3b679SAndreas Boehler    }
37*a1a3b679SAndreas Boehler
38*a1a3b679SAndreas Boehler}
39