xref: /plugin/davcal/vendor/sabre/dav/lib/DAV/Locks/LockInfo.php (revision a1a3b6794e0e143a4a8b51d3185ce2d339be61ab)
1*a1a3b679SAndreas Boehler<?php
2*a1a3b679SAndreas Boehler
3*a1a3b679SAndreas Boehlernamespace Sabre\DAV\Locks;
4*a1a3b679SAndreas Boehler
5*a1a3b679SAndreas Boehler/**
6*a1a3b679SAndreas Boehler * LockInfo class
7*a1a3b679SAndreas Boehler *
8*a1a3b679SAndreas Boehler * An object of the LockInfo class holds all the information relevant to a
9*a1a3b679SAndreas Boehler * single lock.
10*a1a3b679SAndreas Boehler *
11*a1a3b679SAndreas Boehler * @copyright Copyright (C) 2007-2015 fruux GmbH (https://fruux.com/).
12*a1a3b679SAndreas Boehler * @author Evert Pot (http://evertpot.com/)
13*a1a3b679SAndreas Boehler * @license http://sabre.io/license/ Modified BSD License
14*a1a3b679SAndreas Boehler */
15*a1a3b679SAndreas Boehlerclass LockInfo {
16*a1a3b679SAndreas Boehler
17*a1a3b679SAndreas Boehler    /**
18*a1a3b679SAndreas Boehler     * A shared lock
19*a1a3b679SAndreas Boehler     */
20*a1a3b679SAndreas Boehler    const SHARED = 1;
21*a1a3b679SAndreas Boehler
22*a1a3b679SAndreas Boehler    /**
23*a1a3b679SAndreas Boehler     * An exclusive lock
24*a1a3b679SAndreas Boehler     */
25*a1a3b679SAndreas Boehler    const EXCLUSIVE = 2;
26*a1a3b679SAndreas Boehler
27*a1a3b679SAndreas Boehler    /**
28*a1a3b679SAndreas Boehler     * A never expiring timeout
29*a1a3b679SAndreas Boehler     */
30*a1a3b679SAndreas Boehler    const TIMEOUT_INFINITE = -1;
31*a1a3b679SAndreas Boehler
32*a1a3b679SAndreas Boehler    /**
33*a1a3b679SAndreas Boehler     * The owner of the lock
34*a1a3b679SAndreas Boehler     *
35*a1a3b679SAndreas Boehler     * @var string
36*a1a3b679SAndreas Boehler     */
37*a1a3b679SAndreas Boehler    public $owner;
38*a1a3b679SAndreas Boehler
39*a1a3b679SAndreas Boehler    /**
40*a1a3b679SAndreas Boehler     * The locktoken
41*a1a3b679SAndreas Boehler     *
42*a1a3b679SAndreas Boehler     * @var string
43*a1a3b679SAndreas Boehler     */
44*a1a3b679SAndreas Boehler    public $token;
45*a1a3b679SAndreas Boehler
46*a1a3b679SAndreas Boehler    /**
47*a1a3b679SAndreas Boehler     * How long till the lock is expiring
48*a1a3b679SAndreas Boehler     *
49*a1a3b679SAndreas Boehler     * @var int
50*a1a3b679SAndreas Boehler     */
51*a1a3b679SAndreas Boehler    public $timeout;
52*a1a3b679SAndreas Boehler
53*a1a3b679SAndreas Boehler    /**
54*a1a3b679SAndreas Boehler     * UNIX Timestamp of when this lock was created
55*a1a3b679SAndreas Boehler     *
56*a1a3b679SAndreas Boehler     * @var int
57*a1a3b679SAndreas Boehler     */
58*a1a3b679SAndreas Boehler    public $created;
59*a1a3b679SAndreas Boehler
60*a1a3b679SAndreas Boehler    /**
61*a1a3b679SAndreas Boehler     * Exclusive or shared lock
62*a1a3b679SAndreas Boehler     *
63*a1a3b679SAndreas Boehler     * @var int
64*a1a3b679SAndreas Boehler     */
65*a1a3b679SAndreas Boehler    public $scope = self::EXCLUSIVE;
66*a1a3b679SAndreas Boehler
67*a1a3b679SAndreas Boehler    /**
68*a1a3b679SAndreas Boehler     * Depth of lock, can be 0 or Sabre\DAV\Server::DEPTH_INFINITY
69*a1a3b679SAndreas Boehler     */
70*a1a3b679SAndreas Boehler    public $depth = 0;
71*a1a3b679SAndreas Boehler
72*a1a3b679SAndreas Boehler    /**
73*a1a3b679SAndreas Boehler     * The uri this lock locks
74*a1a3b679SAndreas Boehler     *
75*a1a3b679SAndreas Boehler     * TODO: This value is not always set
76*a1a3b679SAndreas Boehler     * @var mixed
77*a1a3b679SAndreas Boehler     */
78*a1a3b679SAndreas Boehler    public $uri;
79*a1a3b679SAndreas Boehler
80*a1a3b679SAndreas Boehler}
81