. */ namespace SP\Domain\ItemPreset; use SP\Core\Exceptions\ConstraintException; use SP\Core\Exceptions\QueryException; use SP\DataModel\ItemPresetData; use SP\DataModel\ItemSearchData; use SP\Domain\ItemPreset\Services\ItemPresetRequest; use SP\Domain\ItemPreset\Services\ItemPresetService; use SP\Infrastructure\Common\Repositories\NoSuchItemException; use SP\Infrastructure\Database\QueryResult; /** * Class ItemPresetService * * @package SP\Domain\Account\Services */ interface ItemPresetServiceInterface { /** * @throws ConstraintException * @throws QueryException */ public function create(ItemPresetRequest $itemPresetRequest): int; /** * @throws ConstraintException * @throws QueryException */ public function update(ItemPresetRequest $itemPresetRequest): int; /** * Deletes an item * * @throws \SP\Core\Exceptions\ConstraintException * @throws \SP\Core\Exceptions\QueryException * @throws \SP\Infrastructure\Common\Repositories\NoSuchItemException */ public function delete(int $id): ItemPresetService; /** * Returns the item for given id * * @throws NoSuchItemException * @throws ConstraintException * @throws QueryException */ public function getById(int $id): ItemPresetData; /** * Returns all the items * * @return ItemPresetData[] * @throws ConstraintException * @throws QueryException */ public function getAll(): array; /** * Searches for items by a given filter * * @throws ConstraintException * @throws QueryException */ public function search(ItemSearchData $itemSearchData): QueryResult; /** * @throws ConstraintException * @throws QueryException */ public function getForCurrentUser(string $type): ?ItemPresetData; /** * @throws ConstraintException * @throws QueryException */ public function getForUser(string $type, int $userId, int $userGroupId, int $userProfileId): ?ItemPresetData; /** * @param int[] $ids * * @throws \SP\Core\Exceptions\ConstraintException * @throws \SP\Core\Exceptions\QueryException * @throws \SP\Domain\Common\Services\ServiceException */ public function deleteByIdBatch(array $ids): int; }