chore: standardize chrono provider
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: Sebastian Krupinski <krupinski01@gmail.com>
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace KTXF\Chrono\Service;
|
||||
|
||||
use KTXF\Chrono\Collection\CollectionBaseInterface;
|
||||
use KTXF\Chrono\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;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user