Files
server/shared/lib/People/Service/ServiceEntityMutableInterface.php
Sebastian Krupinski e48ee82530
All checks were successful
JS Unit Tests / test (pull_request) Successful in 16s
Build Test / build (pull_request) Successful in 18s
PHP Unit Tests / test (pull_request) Successful in 56s
refactor: people provider
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
2026-02-25 00:13:51 -05:00

77 lines
2.3 KiB
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: Sebastian Krupinski <krupinski01@gmail.com>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace KTXF\People\Service;
use KTXF\People\Entity\EntityBaseInterface;
use KTXF\People\Entity\EntityMutableInterface;
/**
* Service Entity Mutable Interface
*
* Optional interface for services that support entity CRUD operations.
*
* @since 2025.05.01
*/
interface ServiceEntityMutableInterface {
public const CAPABILITY_ENTITY_CREATE = 'EntityCreate';
public const CAPABILITY_ENTITY_UPDATE = 'EntityUpdate';
public const CAPABILITY_ENTITY_DELETE = 'EntityDelete';
public const CAPABILITY_ENTITY_COPY = 'EntityCopy';
public const CAPABILITY_ENTITY_MOVE = 'EntityMove';
/**
* Creates a fresh entity instance for composition
*
* @since 2025.05.01
*
* @return EntityMutableInterface Fresh entity object
*/
public function entityFresh(): EntityMutableInterface;
/**
* Creates/imports an entity into a collection
*
* @since 2025.05.01
*
* @param string|int $collection collection identifier
* @param EntityMutableInterface $entity Entity data
* @param array $options additional options
*
* @return EntityBaseInterface Created entity
*/
public function entityCreate(string|int $collection, EntityMutableInterface $entity, array $options = []): EntityBaseInterface;
/**
* Modifies an existing entity
*
* @since 2025.05.01
*
* @param string|int $collection Collection identifier
* @param string|int $identifier Entity identifier
* @param EntityMutableInterface $entity Entity data
*
* @return EntityBaseInterface Modified entity
*/
public function entityUpdate(string|int $collection, string|int $identifier, EntityMutableInterface $entity): EntityBaseInterface;
/**
* Deletes an existing entity in the specified collection
*
* @since 2025.05.01
*
* @param string|int $collection Collection identifier
* @param string|int $identifier Entity identifier to delete
*
* @return EntityBaseInterface Deleted entity
*/
public function entityDelete(string|int $collection, string|int $identifier): EntityBaseInterface;
}