Copied!

LocalProductServiceInterface

LocalProductServiceInterface.php : 21

Methods

publiccreateProduct()

LocalProductServiceInterface.php : 40
public createProduct(ProductCreateStruct $createStruct) : ProductInterface

Parameters

Name Type Default value Description
$createStruct ProductCreateStruct - -

Return values

ProductInterface

Tags
Throws
UnauthorizedException
Throws
InvalidArgumentException

publiccreateProductVariants()

LocalProductServiceInterface.php : 48
public createProductVariants(ProductInterface $product, iterable<string|int, ProductVariantCreateStruct$createStructs) : void

Parameters

Name Type Default value Description
$product ProductInterface - -
$createStructs iterable<string|int, ProductVariantCreateStruct> - -
Tags
Throws
UnauthorizedException
Throws
InvalidArgumentException

publicdeleteProduct()

LocalProductServiceInterface.php : 77
public deleteProduct(ProductInterface $product) : void

Parameters

Name Type Default value Description
$product ProductInterface - -
Tags
Throws
UnauthorizedException

publicdeleteProductTranslation()

LocalProductServiceInterface.php : 89
public deleteProductTranslation(ProductInterface $product, Language $language) : void

Parameters

Name Type Default value Description
$product ProductInterface - -
$language Language - -
Tags
Throws
UnauthorizedException

publicdeleteProductVariantsByBaseProduct()

LocalProductServiceInterface.php : 84
public deleteProductVariantsByBaseProduct(ProductInterface $baseProduct) : array<string|int, string>

Parameters

Name Type Default value Description
$baseProduct ProductInterface - -

Return values

array<string|int, string>

Tags
Throws
UnauthorizedException

publicfindProducts()

ProductServiceInterface.php : 29
public findProducts(ProductQuery $query[, LanguageSettings|null $languageSettings = null ]) : ProductListInterface

Parameters

Name Type Default value Description
$query ProductQuery - -
$languageSettings LanguageSettings|null null -

Return values

ProductListInterface

publicfindProductVariants()

ProductServiceInterface.php : 39
public findProductVariants(ProductInterface $product[, ProductVariantQuery|null $query = null ]) : ProductVariantListInterface

Parameters

Name Type Default value Description
$product ProductInterface - -
$query ProductVariantQuery|null null -

Return values

ProductVariantListInterface

publicgetProduct()

ProductServiceInterface.php : 27

Loads product with given code.

public getProduct(string $code[, LanguageSettings|null $settings = null ]) : ProductInterface

Parameters

Name Type Default value Description
$code string - -
$settings LanguageSettings|null null -

Return values

ProductInterface

Tags
Throws
UnauthorizedException

if the user is not allowed to read the product

Throws
NotFoundException

if the product with the given code does not exist

publicgetProductFromContent()

LocalProductServiceInterface.php : 34

Returns product associated with given Content.

public getProductFromContent(Content $content) : ProductInterface

Parameters

Name Type Default value Description
$content Content - -

Return values

ProductInterface

Tags
Throws
UnauthorizedException
Throws
InvalidArgumentException

publicgetProductVariant()

ProductServiceInterface.php : 37

Loads product variant with given code.

public getProductVariant(string $code[, LanguageSettings|null $settings = null ]) : ProductVariantInterface

Parameters

Name Type Default value Description
$code string - -
$settings LanguageSettings|null null -

Return values

ProductVariantInterface

Tags
Throws
UnauthorizedException

if the user is not allowed to read the product

Throws
NotFoundException

if the product with the given code does not exist

publicisProduct()

LocalProductServiceInterface.php : 26

Checks if Content is a product.

public isProduct(Content $content) : bool

Parameters

Name Type Default value Description
$content Content - -

Return values

bool

publicnewProductCreateStruct()

LocalProductServiceInterface.php : 50
public newProductCreateStruct(ProductTypeInterface $productType, string $mainLanguageCode) : ProductCreateStruct

Parameters

Name Type Default value Description
$productType ProductTypeInterface - -
$mainLanguageCode string - -

Return values

ProductCreateStruct

publicnewProductUpdateStruct()

LocalProductServiceInterface.php : 55
public newProductUpdateStruct(ProductInterface $product) : ProductUpdateStruct

Parameters

Name Type Default value Description
$product ProductInterface - -

Return values

ProductUpdateStruct

publicupdateProduct()

LocalProductServiceInterface.php : 62
public updateProduct(ProductUpdateStruct $updateStruct) : ProductInterface

Parameters

Name Type Default value Description
$updateStruct ProductUpdateStruct - -

Return values

ProductInterface

Tags
Throws
NotFoundException
Throws
UnauthorizedException
Throws
InvalidArgumentException

publicupdateProductVariant()

LocalProductServiceInterface.php : 69
public updateProductVariant(ProductVariantInterface $productVariant, ProductVariantUpdateStruct $updateStruct) : ProductVariantInterface

Parameters

Name Type Default value Description
$productVariant ProductVariantInterface - -
$updateStruct ProductVariantUpdateStruct - -

Return values

ProductVariantInterface

Tags
Throws
NotFoundException
Throws
UnauthorizedException
Throws
InvalidArgumentException