1<?php
2
3namespace Sabre\DAV\Locks\Backend;
4
5use Sabre\DAV\Locks;
6
7/**
8 * If you are defining your own Locks backend, you must implement this
9 * interface.
10 *
11 * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
12 * @author Evert Pot (http://evertpot.com/)
13 * @license http://sabre.io/license/ Modified BSD License
14 */
15interface BackendInterface {
16
17    /**
18     * Returns a list of Sabre\DAV\Locks\LockInfo objects
19     *
20     * This method should return all the locks for a particular uri, including
21     * locks that might be set on a parent uri.
22     *
23     * If returnChildLocks is set to true, this method should also look for
24     * any locks in the subtree of the uri for locks.
25     *
26     * @param string $uri
27     * @param bool $returnChildLocks
28     * @return array
29     */
30    function getLocks($uri, $returnChildLocks);
31
32    /**
33     * Locks a uri
34     *
35     * @param string $uri
36     * @param Locks\LockInfo $lockInfo
37     * @return bool
38     */
39    function lock($uri, Locks\LockInfo $lockInfo);
40
41    /**
42     * Removes a lock from a uri
43     *
44     * @param string $uri
45     * @param Locks\LockInfo $lockInfo
46     * @return bool
47     */
48    function unlock($uri, Locks\LockInfo $lockInfo);
49
50}
51