refactor: mail interfaces
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -11,6 +11,8 @@ namespace KTXF\Mail\Service;
|
||||
|
||||
use KTXF\Mail\Collection\CollectionBaseInterface;
|
||||
use KTXF\Mail\Collection\CollectionMutableInterface;
|
||||
use KTXF\Mail\Collection\CollectionPropertiesBaseInterface;
|
||||
use KTXF\Resource\Identifier\CollectionIdentifier;
|
||||
|
||||
/**
|
||||
* Mail Service Collection Mutable Interface
|
||||
@@ -41,48 +43,48 @@ interface ServiceCollectionMutableInterface {
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @param string|int|null $location Parent collection ID (null for root)
|
||||
* @param CollectionMutableInterface $collection Collection to create
|
||||
* @param CollectionIdentifier $target Target collection identifier (parent)
|
||||
* @param CollectionPropertiesBaseInterface $properties Collection properties
|
||||
* @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;
|
||||
public function collectionCreate(CollectionIdentifier|null $target, CollectionPropertiesBaseInterface $properties, array $options = []): CollectionBaseInterface;
|
||||
|
||||
/**
|
||||
* Updates an existing collection
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @param string|int $identifier Collection ID
|
||||
* @param CollectionMutableInterface $collection Updated collection data
|
||||
* @param CollectionIdentifier $target Target collection identifier
|
||||
* @param CollectionPropertiesBaseInterface $properties Updated collection data
|
||||
*
|
||||
* @return CollectionBaseInterface Updated collection
|
||||
*/
|
||||
public function collectionUpdate(string|int $identifier, CollectionMutableInterface $collection): CollectionBaseInterface;
|
||||
public function collectionUpdate(CollectionIdentifier $target, CollectionPropertiesBaseInterface $properties): CollectionBaseInterface;
|
||||
|
||||
/**
|
||||
* Deletes a collection
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @param string|int $identifier Collection ID
|
||||
* @param CollectionIdentifier $target Target collection identifier
|
||||
* @param bool $force Force deletion even if not empty
|
||||
*
|
||||
* @return CollectionBaseInterface|true Collection object on soft delete, true on hard delete
|
||||
*/
|
||||
public function collectionDelete(string|int $identifier, bool $force = false): CollectionBaseInterface | true;
|
||||
public function collectionDelete(CollectionIdentifier $target, bool $force = false): CollectionBaseInterface | true;
|
||||
|
||||
/**
|
||||
* Moves a collection to a new parent
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @param string|int $identifier Collection ID
|
||||
* @param string|int|null $targetLocation New parent ID (null for root)
|
||||
* @param CollectionIdentifier $source Source collection identifier
|
||||
* @param CollectionIdentifier $target Target collection identifier
|
||||
*
|
||||
* @return CollectionBaseInterface Moved collection
|
||||
*/
|
||||
public function collectionMove(string|int $identifier, string|int|null $targetLocation): CollectionBaseInterface;
|
||||
public function collectionMove(CollectionIdentifier $target, CollectionIdentifier $source): CollectionBaseInterface;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user