ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
Container.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\WebDAV\Entity;
22
23use Sabre\DAV\ICollection;
24use Sabre\DAV\INode;
26use Sabre\DAV\Exception\NotFound;
27
31class Container extends BaseContainer implements ICollection
32{
33 public function __construct(
34 Factory $factory,
35 string $path,
36 ?Proxy $object_proxy = null,
37 protected ?Container $parent = null
38 ) {
39 parent::__construct($factory, $path, $object_proxy);
40 }
41
42 public function getParent(): ?Container
43 {
44 return $this->parent;
45 }
46
47 public function getChild($name): INode
48 {
49 if ($name === ProblemInfoFile::FILE_NAME) {
50 $info_file = $this->factory->getProblemInfoFile($this);
51 if ($info_file->hasProblems()) {
52 return $info_file;
53 }
54 throw new NotFound($name);
55 }
56 return $this->factory->get($name, $this) ?? throw new NotFound($name);
57 }
58
59 #[\Override]
60 public function getFullPath(): string
61 {
62 $path = $this->getName();
63 $parent = $this->getParent();
64 while ($parent !== null) {
65 $path = $parent->getName() . '/' . $path;
66 $parent = $parent->getParent();
67 if ($parent?->getParent() === null) {
68 break;
69 }
70 }
71 return $path;
72 }
73
74}
factory()
__construct(Factory $factory, string $path, ?Proxy $object_proxy=null, protected ?Container $parent=null)
Definition: Container.php:33
$path
Definition: ltiservices.php:30
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc