Files
server/shared/lib/Resource/Documents/Service/ServiceCollectionMutableInterface.php
Sebastian Krupinski 1f3e87535b
All checks were successful
JS Unit Tests / test (pull_request) Successful in 21s
Build Test / build (pull_request) Successful in 25s
PHP Unit Tests / test (pull_request) Successful in 46s
refactor: documents
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
2026-03-03 22:13:36 -05:00

74 lines
2.2 KiB
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: Sebastian Krupinski <krupinski01@gmail.com>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace KTXF\Resource\Documents\Service;
use KTXF\Resource\Documents\Collection\CollectionBaseInterface;
use KTXF\Resource\Documents\Collection\CollectionMutableInterface;
/**
* Chrono Service Collection Mutable Interface
*
* @since 2025.05.01
*/
interface ServiceCollectionMutableInterface extends ServiceBaseInterface {
public const CAPABILITY_COLLECTION_CREATE = 'CollectionCreate';
public const CAPABILITY_COLLECTION_UPDATE = 'CollectionUpdate';
public const CAPABILITY_COLLECTION_DELETE = 'CollectionDelete';
/**
* Creates a fresh collection instance for configuration
*
* @since 2025.05.01
*
* @return CollectionMutableInterface Fresh collection object
*/
public function collectionFresh(): CollectionMutableInterface;
/**
* Creates a new collection
*
* @since 2025.05.01
*
* @param string|int|null $location Parent collection ID (null for root)
* @param CollectionMutableInterface $collection Collection to create
* @param array $options Protocol-specific options
*
* @return CollectionBaseInterface Created collection with assigned ID
*/
public function collectionCreate(string|int|null $location, CollectionMutableInterface $collection, array $options = []): CollectionBaseInterface;
/**
* Updates an existing collection
*
* @since 2025.05.01
*
* @param string|int $identifier Collection ID
* @param CollectionMutableInterface $collection Updated collection data
*
* @return CollectionBaseInterface Updated collection
*/
public function collectionUpdate(string|int $identifier, CollectionMutableInterface $collection): CollectionBaseInterface;
/**
* Deletes a collection
*
* @since 2025.05.01
*
* @param string|int $identifier Collection ID
* @param bool $force Force deletion even if not empty
* @param bool $recursive Recursively delete contents
*
* @return bool True if deleted
*/
public function collectionDelete(string|int $identifier, bool $force = false, bool $recursive = false): bool;
}