ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilDAVMountPoint.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 use Sabre\DAV\INode;
24 
34 class ilDAVMountPoint implements ICollection
35 {
37 
38  protected int $user_id;
39 
40  public function __construct(
41  protected string $client_id,
42  protected ilWebDAVObjFactory $web_dav_object_factory,
43  protected ilWebDAVRepositoryHelper $repo_helper,
44  ilObjUser $user
45  ) {
46  $this->user_id = $user->getId();
47  }
48 
49  public function getName(): string
50  {
51  return 'MountPoint';
52  }
53 
57  public function getChildren(): array
58  {
59  if ($this->user_id === ANONYMOUS_USER_ID) {
60  throw new Forbidden('Only for logged in users');
61  }
62  return [$this->web_dav_object_factory->getClientNode($this->client_id)];
63  }
64 
65  public function getChild($name): ilDAVClientNode
66  {
67  return $this->web_dav_object_factory->getClientNode($name);
68  }
69 
70  public function childExists($name): bool
71  {
72  return $name === $this->client_id;
73  }
74 
75  public function getLastModified(): int
76  {
77  return strtotime('2000-01-01');
78  }
79 }
const ANONYMOUS_USER_ID
Definition: constants.php:27
This class represents the absolut Root-Node on a WebDAV request.
__construct(protected string $client_id, protected ilWebDAVObjFactory $web_dav_object_factory, protected ilWebDAVRepositoryHelper $repo_helper, ilObjUser $user)
$client_id
Definition: ltiauth.php:66