Class DefaultCustomerReviewService
java.lang.Object
de.hybris.platform.customerreview.impl.DefaultCustomerReviewService
- All Implemented Interfaces:
CustomerReviewService
Default implementation for CustomerReviewService.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateCustomerReview(Double rating, String headline, String comment, UserModel user, ProductModel product) Creates a new customer review based on the given parametersgetAverageRating(ProductModel product) Returns the average rating of all reviews for the given product.protected CustomerReviewDaoprotected ModelServicegetNumberOfReviews(ProductModel product) Returns the number of reviews for the given productgetReviewsForCustomer(UserModel userModel) Get the reviews for the specified customer.getReviewsForProduct(ProductModel product) Get the reviews for the specified product.getReviewsForProductAndLanguage(ProductModel product, LanguageModel language) Get the reviews for the specified product in the specified language.voidsetCustomerReviewDao(CustomerReviewDao customerReviewDao) voidsetModelService(ModelService modelService)
-
Constructor Details
-
DefaultCustomerReviewService
public DefaultCustomerReviewService()
-
-
Method Details
-
createCustomerReview
public CustomerReviewModel createCustomerReview(Double rating, String headline, String comment, UserModel user, ProductModel product) Description copied from interface:CustomerReviewServiceCreates a new customer review based on the given parameters- Specified by:
createCustomerReviewin interfaceCustomerReviewService- Parameters:
rating- the ratingheadline- the headlinecomment- the commentsuser- the user who created the reviewproduct- the product reviewed- Returns:
- the newly created review
-
getAverageRating
Description copied from interface:CustomerReviewServiceReturns the average rating of all reviews for the given product.- Specified by:
getAverageRatingin interfaceCustomerReviewService- Parameters:
product- the product- Returns:
- the average rating
-
getNumberOfReviews
Description copied from interface:CustomerReviewServiceReturns the number of reviews for the given product- Specified by:
getNumberOfReviewsin interfaceCustomerReviewService- Parameters:
product- instance ofProductModelto find the number of reviews for- Returns:
- the number of reviews
-
getReviewsForProduct
Description copied from interface:CustomerReviewServiceGet the reviews for the specified product. Gets all the reviews in any language. (Reviews are restricted by approval status) The reviews are ordered by creation date with the most recent first.- Specified by:
getReviewsForProductin interfaceCustomerReviewService- Parameters:
product- the product- Returns:
- the reviews
-
getReviewsForCustomer
Description copied from interface:CustomerReviewServiceGet the reviews for the specified customer. Gets all the reviews in any language. (Reviews are restricted by approval status) The reviews are ordered by created date with the most recent first.- Specified by:
getReviewsForCustomerin interfaceCustomerReviewService- Parameters:
userModel- the customer- Returns:
- the reviews
-
getReviewsForProductAndLanguage
public List<CustomerReviewModel> getReviewsForProductAndLanguage(ProductModel product, LanguageModel language) Description copied from interface:CustomerReviewServiceGet the reviews for the specified product in the specified language. The reviews are ordered by creation date with the most recent first.- Specified by:
getReviewsForProductAndLanguagein interfaceCustomerReviewService- Parameters:
product- the productlanguage- the language- Returns:
- the reviews
-
getCustomerReviewDao
-
setCustomerReviewDao
-
getModelService
-
setModelService
-