◆ __construct()
| ILIAS\WebDAV\Lock\Backend::__construct |
( |
private Factory |
$entity_factory, |
|
|
private LocksRepository |
$locks_repository |
|
) |
| |
Definition at line 35 of file Backend.php.
38 {
40 $this->user_id =
$DIC->user()->getId();
41 }
References $DIC.
◆ getLocks()
| ILIAS\WebDAV\Lock\Backend::getLocks |
( |
|
$uri, |
|
|
|
$returnChildLocks |
|
) |
| |
- Returns
- LockInfo[]
Definition at line 46 of file Backend.php.
46 : array
47 {
48 $entity = $this->entity_factory->getByFullPath($uri);
49 if ($entity === null) {
50 return [];
51 }
52
53 $lock_object = $this->locks_repository->maybeGetLockFromObjId($entity->getObjectProxy()->getObjId());
54 if ($lock_object === null) {
55 return [];
56 }
57
58 return [
59 $lock_object->getAsSabreDavLock($uri),
60 ];
61 }
◆ lock()
| ILIAS\WebDAV\Lock\Backend::lock |
( |
|
$uri, |
|
|
LockInfo |
$lock_info |
|
) |
| |
Definition at line 63 of file Backend.php.
63 : bool
64 {
65 $entity = $this->entity_factory->getByFullPath($uri);
66 $obj_id = $entity?->getObjectProxy()->getObjId();
67 if ($obj_id === null) {
68 return false;
69 }
70
71 $ilias_lock = new Lock(
72 $lock_info->token,
73 $obj_id,
74 $this->user_id,
75 $lock_info->owner,
76 time() + 3600,
77 $lock_info->depth,
78 'w',
79 $lock_info->scope
80 );
81 $this->locks_repository->save($ilias_lock);
82
83 $proxy = $entity?->getObjectProxy();
84 if ($proxy !== null && $proxy->getType() === Type::FILE) {
85 $proxy->getStreamHandler()?->publish();
86 }
87 return true;
88 }
◆ unlock()
| ILIAS\WebDAV\Lock\Backend::unlock |
( |
|
$uri, |
|
|
LockInfo |
$lock_info |
|
) |
| |
Definition at line 90 of file Backend.php.
90 : bool
91 {
92 $ilias_lock = $this->locks_repository->maybeGetLockFromToken($lock_info->token);
93
94 if ($ilias_lock !== null && $ilias_lock->getIliasOwner() === $this->user_id) {
95 $this->locks_repository->remove($lock_info->token);
96 return true;
97 }
98 return false;
99 }
◆ $user_id
| int ILIAS\WebDAV\Lock\Backend::$user_id |
|
private |
The documentation for this class was generated from the following file: