ILIAS  release_8 Revision v8.24
class.ilDAVMountPoint.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
21use Sabre\DAV\Exception\Forbidden;
22use Sabre\DAV\ICollection;
23
33class ilDAVMountPoint implements ICollection
34{
35 use ilWebDAVReadOnlyNodeWriteFunctionsTrait;
36
37 protected string $client_id;
38 protected int $user_id;
41
42 public function __construct(
43 string $client_id,
46 ilObjUser $user
47 ) {
48 $this->client_id = $client_id;
49 $this->web_dav_object_factory = $web_dav_object_factory;
50 $this->repo_helper = $repo_helper;
51 $this->user_id = $user->getId();
52 }
53
54 public function getName(): string
55 {
56 return 'MountPoint';
57 }
58
62 public function getChildren(): array
63 {
64 if ($this->user_id === ANONYMOUS_USER_ID) {
65 throw new Forbidden('Only for logged in users');
66 }
67 return array($this->web_dav_object_factory->getClientNode($this->client_id));
68 }
69
70 public function getChild($name): ilDAVClientNode
71 {
72 return $this->web_dav_object_factory->getClientNode($name);
73 }
74
75 public function childExists($name): bool
76 {
77 if ($name === $this->client_id) {
78 return true;
79 }
80 return false;
81 }
82
83 public function getLastModified(): int
84 {
85 return strtotime('2000-01-01');
86 }
87}
This class represents the absolut Root-Node on a WebDAV request.
ilWebDAVRepositoryHelper $repo_helper
__construct(string $client_id, ilWebDAVObjFactory $web_dav_object_factory, ilWebDAVRepositoryHelper $repo_helper, ilObjUser $user)
ilWebDAVObjFactory $web_dav_object_factory
User class.
const ANONYMOUS_USER_ID
Definition: constants.php:27
if($format !==null) $name
Definition: metadata.php:247