. */ namespace SP\Domain\User\Ports; use SP\DataModel\ItemSearchData; use SP\DataModel\UserProfileItemWithIdAndName; use SP\Domain\Common\Services\ServiceException; use SP\Domain\Core\Exceptions\ConstraintException; use SP\Domain\Core\Exceptions\QueryException; use SP\Infrastructure\Common\Repositories\DuplicatedItemException; use SP\Infrastructure\Common\Repositories\NoSuchItemException; use SP\Infrastructure\Database\QueryResult; /** * Class UserProfileService * * @package SP\Domain\Common\Services\UserProfile */ interface UserProfileServiceInterface { /** * @throws ConstraintException * @throws QueryException * @throws NoSuchItemException */ public function getById(int $id): UserProfileItemWithIdAndName; /** * @throws ConstraintException * @throws QueryException */ public function search(ItemSearchData $itemSearchData): QueryResult; /** * @throws ConstraintException * @throws QueryException * @throws NoSuchItemException */ public function delete(int $id): UserProfileServiceInterface; /** * @param int[] $ids * * @throws ServiceException * @throws ConstraintException * @throws QueryException */ public function deleteByIdBatch(array $ids): int; /** * @throws ConstraintException * @throws QueryException * @throws DuplicatedItemException */ public function create(UserProfileItemWithIdAndName $itemData): int; /** * @throws ConstraintException * @throws QueryException * @throws DuplicatedItemException * @throws ServiceException */ public function update(UserProfileItemWithIdAndName $itemData): void; /** * @throws ConstraintException * @throws QueryException */ public function getUsersForProfile(int $id): array; /** * Get all items from the service's repository * * @return UserProfileItemWithIdAndName[] * @throws ConstraintException * @throws QueryException */ public function getAll(): array; }