catalog->atomic($operation); } public function modelMetadata(int $modelId): ?array { return $this->catalog->modelMetadata($modelId); } public function updateModelMetadata(int $modelId, array $expected, array $replacement): array { return $this->catalog->updateModelMetadata($modelId, $expected, $replacement); } public function changeFileStatus(int $fileId, string $expectedStatus, string $targetStatus): array { return $this->catalog->changeFileStatus($fileId, $expectedStatus, $targetStatus); } public function file(int $fileId): ?array { return $this->catalog->file($fileId); } public function fileByManagedPath(string $managedPath): ?array { return $this->catalog->fileByManagedPath($managedPath); } public function registerFile( ?int $modelId, string $managedPath, string $hash, int $size, ?string $mime = null, string $status = 'Present' ): int { return $this->catalog->recordFile($modelId, $managedPath, $hash, $size, $mime, $status); } public function createModel(string $folderPath, string $modelName): int { return $this->catalog->atomic(fn (): int => $this->catalog->createModel($folderPath, $modelName)); } /** @return array{model: array, folder: array, files: array}|null */ public function aggregate(int $modelId): ?array { return $this->catalog->aggregate($modelId); } public function assignFiles(int $modelId, array $fileIds): void { $this->catalog->atomic(fn () => $this->catalog->changeFileOwner($fileIds, null, $modelId)); } public function reassignFiles(int $expectedModelId, int $targetModelId, array $fileIds): void { $this->catalog->atomic(fn () => $this->catalog->changeFileOwner($fileIds, $expectedModelId, $targetModelId)); } public function detachFiles(int $expectedModelId, array $fileIds): void { $this->catalog->atomic(fn () => $this->catalog->changeFileOwner($fileIds, $expectedModelId, null)); } }