service->getLabel(); } /** @return INode[] */ public function getChildren(): array { $nodes = []; $collections = $this->service->collectionList(null); foreach ($collections as $collection) { $nodes[] = new FilesCollectionNode( $this->service, $collection, ); } /** @var \KTXF\Documents\Entity\EntityBaseInterface[] $entities */ $entities = $this->service->entityListBulk(null); foreach ($entities as $entity) { if (is_object($entity)) { $nodes[] = new FilesEntityNode( $this->service, $entity, ); } } return $nodes; } public function createDirectory($name): void { if (!$this->service instanceof ServiceCollectionMutableInterface) { throw new Forbidden('Service does not support collection creation'); } $properties = $this->service->collectionFresh()->getProperties(); $properties->setLabel($name); $this->service->collectionCreate(null, $properties); } }