albumMapper->create($this->userId, $name); } public function getChild($name) { foreach ($this->getChildren() as $child) { if ($child->getName() === $name) { return $child; } } throw new NotFound(); } /** * @return AlbumRootBase[] */ public function getChildren(): array { if ($this->children === null) { $albumInfos = $this->albumMapper->getForUser($this->userId); $this->children = array_map(fn (AlbumInfo $albumInfo): AlbumRoot => new AlbumRoot( $this->albumMapper, new AlbumWithFiles($albumInfo, $this->albumMapper), $this->rootFolder, $this->userId, $this->userConfigService, $this->logger, $this->userManager, ), $albumInfos); } return $this->children; } public function childExists($name): bool { try { $this->getChild($name); return true; } catch (NotFound) { return false; } } public function getLastModified(): int { return 0; } }