Search in sources :

Example 1 with ReadableProductVariation

use of com.salesmanager.shop.model.catalog.product.variation.ReadableProductVariation in project shopizer by shopizer-ecommerce.

the class ProductVariationFacadeImpl method get.

@Override
public ReadableProductVariation get(Long id, MerchantStore store, Language language) {
    Validate.notNull(store, "MerchantStore cannot be null");
    Validate.notNull(language, "Language cannot be null");
    ProductVariation variation = productVariationService.getById(store, id, language);
    if (variation == null) {
        throw new ResourceNotFoundException("ProductVariation not found for id [" + id + "] and store [" + store.getCode() + "]");
    }
    return readableProductVariationMapper.convert(variation, store, language);
}
Also used : ProductVariation(com.salesmanager.core.model.catalog.product.variation.ProductVariation) ReadableProductVariation(com.salesmanager.shop.model.catalog.product.variation.ReadableProductVariation) PersistableProductVariation(com.salesmanager.shop.model.catalog.product.variation.PersistableProductVariation) ResourceNotFoundException(com.salesmanager.shop.store.api.exception.ResourceNotFoundException)

Aggregations

ProductVariation (com.salesmanager.core.model.catalog.product.variation.ProductVariation)1 PersistableProductVariation (com.salesmanager.shop.model.catalog.product.variation.PersistableProductVariation)1 ReadableProductVariation (com.salesmanager.shop.model.catalog.product.variation.ReadableProductVariation)1 ResourceNotFoundException (com.salesmanager.shop.store.api.exception.ResourceNotFoundException)1