. */ namespace SP\Domain\User\Ports; use SP\Domain\Common\Services\ServiceException; use SP\Domain\Core\Dtos\ItemSearchDto; use SP\Domain\Core\Exceptions\ConstraintException; use SP\Domain\Core\Exceptions\QueryException; use SP\Domain\User\Models\UserProfile as UserProfileModel; 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 UserProfileService { /** * @throws ConstraintException * @throws QueryException * @throws NoSuchItemException */ public function getById(int $id): UserProfileModel; /** * @return QueryResult * @throws ConstraintException * @throws QueryException */ public function search(ItemSearchDto $itemSearchData): QueryResult; /** * @throws ConstraintException * @throws QueryException * @throws NoSuchItemException */ public function delete(int $id): void; /** * @param int[] $ids * * @throws ServiceException * @throws ConstraintException * @throws QueryException */ public function deleteByIdBatch(array $ids): int; /** * @throws ConstraintException * @throws QueryException * @throws DuplicatedItemException */ public function create(UserProfileModel $userProfile): int; /** * @throws ConstraintException * @throws QueryException * @throws DuplicatedItemException * @throws ServiceException */ public function update(UserProfileModel $userProfile): void; /** * @throws ConstraintException * @throws QueryException */ public function getUsersForProfile(int $id): array; /** * Get all items from the service's repository * * @return array * @throws ConstraintException * @throws QueryException */ public function getAll(): array; }