. */ namespace SP\Domain\Plugin\Ports; use Defuse\Crypto\Exception\CryptoException; use SP\Domain\Common\Services\ServiceException; use SP\Domain\Core\Exceptions\ConstraintException; use SP\Domain\Core\Exceptions\NoSuchPropertyException; use SP\Domain\Core\Exceptions\QueryException; use SP\Infrastructure\Common\Repositories\NoSuchItemException; /** * Interface PluginOperation */ interface PluginOperationInterface { /** * @param int $itemId * @param mixed $data * * @return int * @throws CryptoException * @throws ConstraintException * @throws NoSuchPropertyException * @throws QueryException * @throws ServiceException */ public function create(int $itemId, object $data): int; /** * @param int $itemId * @param mixed $data * * @return int * @throws CryptoException * @throws ConstraintException * @throws NoSuchPropertyException * @throws QueryException * @throws ServiceException */ public function update(int $itemId, object $data): int; /** * @throws ConstraintException * @throws QueryException * @throws NoSuchItemException */ public function delete(int $itemId): void; /** * @template T * * @param int $itemId * @param class-string $class * * @return T|null * * @throws ConstraintException * @throws CryptoException * @throws NoSuchPropertyException * @throws QueryException * @throws ServiceException */ public function get(int $itemId, string $class): ?object; }