ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
Lock.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\WebDAV\Lock;
22
23use Sabre\DAV\Locks\LockInfo;
24
25class Lock implements LockObject
26{
27 public function __construct(
28 protected string $token,
29 protected int $obj_id,
30 protected int $ilias_owner,
31 protected string $dav_owner,
32 protected int $expires,
33 protected int $depth,
34 protected string $type,
35 protected int $scope
36 ) {
37 }
38
39 public function getToken(): string
40 {
41 return $this->token;
42 }
43
44 public function getObjId(): int
45 {
46 return $this->obj_id;
47 }
48
49 public function getIliasOwner(): int
50 {
51 return $this->ilias_owner;
52 }
53
54 public function getDavOwner(): string
55 {
56 return $this->dav_owner;
57 }
58
59 public function getExpires(): int
60 {
61 return $this->expires;
62 }
63
64 public function getDepth(): int
65 {
66 return $this->depth;
67 }
68
69 public function getType(): string
70 {
71 return $this->type;
72 }
73
74 public function getScope(): int
75 {
76 return $this->scope;
77 }
78
79 public function getAsSabreDavLock(string $uri): LockInfo
80 {
81 $sabre_lock = new LockInfo();
82 $sabre_lock->created = $this->expires - 3600;
83 $sabre_lock->depth = $this->depth;
84 $sabre_lock->owner = $this->dav_owner;
85 $sabre_lock->scope = $this->scope;
86 $sabre_lock->timeout = $this->expires - time();
87 $sabre_lock->token = $this->token;
88 $sabre_lock->uri = $uri;
89
90 return $sabre_lock;
91 }
92}
__construct(protected string $token, protected int $obj_id, protected int $ilias_owner, protected string $dav_owner, protected int $expires, protected int $depth, protected string $type, protected int $scope)
Definition: Lock.php:27
getAsSabreDavLock(string $uri)
Definition: Lock.php:79
$scope
Definition: ltiregstart.php:51
$token
Definition: xapitoken.php:67