. */ 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; use SP\Infrastructure\Database\QueryResult; use SP\Infrastructure\Plugin\Repositories\PluginDataModel; /** * Class PluginDataInterface */ interface PluginDataInterface { /** * Creates an item * * @throws CryptoException * @throws ConstraintException * @throws NoSuchPropertyException * @throws QueryException * @throws ServiceException */ public function create(PluginDataModel $itemData): QueryResult; /** * Updates an item * * @throws CryptoException * @throws ConstraintException * @throws NoSuchPropertyException * @throws QueryException * @throws ServiceException */ public function update(PluginDataModel $itemData): int; /** * Returns the item for given plugin and id * * @throws NoSuchItemException * @throws CryptoException * @throws ConstraintException * @throws NoSuchPropertyException * @throws QueryException * @throws ServiceException */ public function getByItemId(string $name, int $id): PluginDataModel; /** * Returns the item for given id * * @return PluginDataModel[] * @throws CryptoException * @throws ConstraintException * @throws NoSuchPropertyException * @throws QueryException * @throws NoSuchItemException * @throws ServiceException */ public function getById(string $id): array; /** * Returns all the items * * @return PluginDataModel[] * @throws CryptoException * @throws ConstraintException * @throws NoSuchPropertyException * @throws QueryException * @throws ServiceException */ public function getAll(): array; /** * Deletes an item * * @throws ConstraintException * @throws QueryException * @throws NoSuchItemException */ public function delete(string $id): void; /** * Deletes an item * * @throws NoSuchItemException * @throws ConstraintException * @throws QueryException */ public function deleteByItemId(string $name, int $itemId): void; }