1<?php
2
3namespace Sabre\DAV\PropertyStorage\Backend;
4
5use Sabre\DAV\PropFind;
6use Sabre\DAV\PropPatch;
7
8/**
9 * Propertystorage backend interface.
10 *
11 * Propertystorage backends must implement this interface to be used by the
12 * propertystorage plugin.
13 *
14 * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
15 * @author Evert Pot (http://evertpot.com/)
16 * @license http://sabre.io/license/ Modified BSD License
17 */
18interface BackendInterface {
19
20    /**
21     * Fetches properties for a path.
22     *
23     * This method received a PropFind object, which contains all the
24     * information about the properties that need to be fetched.
25     *
26     * Usually you would just want to call 'get404Properties' on this object,
27     * as this will give you the _exact_ list of properties that need to be
28     * fetched, and haven't yet.
29     *
30     * However, you can also support the 'allprops' property here. In that
31     * case, you should check for $propFind->isAllProps().
32     *
33     * @param string $path
34     * @param PropFind $propFind
35     * @return void
36     */
37    function propFind($path, PropFind $propFind);
38
39    /**
40     * Updates properties for a path
41     *
42     * This method received a PropPatch object, which contains all the
43     * information about the update.
44     *
45     * Usually you would want to call 'handleRemaining' on this object, to get;
46     * a list of all properties that need to be stored.
47     *
48     * @param string $path
49     * @param PropPatch $propPatch
50     * @return void
51     */
52    function propPatch($path, PropPatch $propPatch);
53
54    /**
55     * This method is called after a node is deleted.
56     *
57     * This allows a backend to clean up all associated properties.
58     *
59     * The delete method will get called once for the deletion of an entire
60     * tree.
61     *
62     * @param string $path
63     * @return void
64     */
65    function delete($path);
66
67    /**
68     * This method is called after a successful MOVE
69     *
70     * This should be used to migrate all properties from one path to another.
71     * Note that entire collections may be moved, so ensure that all properties
72     * for children are also moved along.
73     *
74     * @param string $source
75     * @param string $destination
76     * @return void
77     */
78    function move($source, $destination);
79
80}
81