class GroupProductManager extends TranslatableManager

Class GroupProductManager is injected as alligator.group.product_manager service. GroupProductManager handles the logic for managed entity.

Properties

protected ProductRepository $repository
protected ProductEventContainer $eventContainer

Methods

setRepositoryLocale(ContainerInterface|null $container)

Sets the repository request default locale

setRepository(mixed $repository)

No description

mixed
getLanguagesForIds(array $ids)

No description

__construct(GroupProductRepository $repository, ProductEventContainer $eventContainer)

No description

saveBundleProduct(Product $product, ArrayCollection $productsArray, array $indexedProducts, bool $generatePrice)

Persist new bundle product

editBundleProduct(mixed $product, array $productsArray, array $indexedProducts, bool $generatePrice)

Merge group product

updateGroupProductPrice(Product $product)

Update group products price

deleteBundleProduct(int $id)

Remove group product

mixed
getGroupProductById(int $id)

Find group product by id

mixed
getBundledProductsForGroupProduct(int $groupId)

Find group product with all related products by group product id

getBundleProductForProductId(int $productId)

Find group product with all related products by related product id

Details

in TranslatableManager at line 30
setRepositoryLocale(ContainerInterface|null $container)

Sets the repository request default locale

Parameters

ContainerInterface|null $container

Exceptions

InvalidArgumentException if repository is not an instance of TranslatableRepository

in TranslatableManager at line 63
setRepository(mixed $repository)

Parameters

mixed $repository

in TranslatableManager at line 73
mixed getLanguagesForIds(array $ids)

Parameters

array $ids

Return Value

mixed

at line 41
__construct(GroupProductRepository $repository, ProductEventContainer $eventContainer)

Parameters

GroupProductRepository $repository
ProductEventContainer $eventContainer

at line 58
GroupProduct saveBundleProduct(Product $product, ArrayCollection $productsArray, array $indexedProducts, bool $generatePrice)

Persist new bundle product

Parameters

Product $product
ArrayCollection $productsArray
array $indexedProducts
bool $generatePrice

Return Value

GroupProduct

Exceptions

InvalidArgumentException

at line 90
PrimaryKeyInterface editBundleProduct(mixed $product, array $productsArray, array $indexedProducts, bool $generatePrice)

Merge group product

Parameters

mixed $product
array $productsArray
array $indexedProducts
bool $generatePrice

Return Value

PrimaryKeyInterface

Exceptions

InvalidArgumentException

at line 145
updateGroupProductPrice(Product $product)

Update group products price

Parameters

Product $product

at line 180
deleteBundleProduct(int $id)

Remove group product

Parameters

int $id

Exceptions

NoResultException
NonUniqueResultException

at line 196
mixed getGroupProductById(int $id)

Find group product by id

Parameters

int $id

Return Value

mixed

Exceptions

NoResultException
NonUniqueResultException

at line 210
mixed getBundledProductsForGroupProduct(int $groupId)

Find group product with all related products by group product id

Parameters

int $groupId

Return Value

mixed

Exceptions

NoResultException
NonUniqueResultException

at line 224
GroupProduct getBundleProductForProductId(int $productId)

Find group product with all related products by related product id

Parameters

int $productId

Return Value

GroupProduct

Exceptions

NoResultException
NonUniqueResultException