class ProductGroupManager implements BasicEntityManagerInterface, JQGridInterface

Class ProductGroupManager is injected as alligator.product.group.manager service. ProductGroupManager handles the logic for entity.

Traits

Trait JQGridManagerTrait
Class BlockElementManagerTrait. Handles reading data for block elements

Constants

PRODUCT_GROUP_CACHE_KEY

Properties

protected ProductGroupRepository $repository

Methods

mixed
searchForJQGRID(array $searchParams, array $sortParams = array(), array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

No description

mixed
findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

No description

mixed
getCountForJQGRID(array|null $searchParams = null, array|null $sortParams = null, array|null $additionalParams = array(), JQGridWrapper|null $jqGridWrapper = null)

No description

array
getEntityNamesForIds(array $ids)

Get id and name of entity

__construct(ProductGroupRepository $repository, ProductManager $productManager, ContainerInterface $container)

No description

getReference(mixed $id)

Get reference to Product Group class

findByPk(mixed $id)

Get Product Group by id

bool
deleteProductGroups(array $ids)

Delete multiple Product Groups

mixed
getAllGroupsFromCache()

Get all product group data from cache, in there is no cached data cache it

reCacheAllGroups()

Set product groups to cache

array
getProductGroupsArray(array $ids)

Get array of Product Groups for ids

handlePersist(ProductGroup $productGroup)

Save new Product Group entity

updateProductGroups(ProductGroupEvent $productGroupEvent)

No description

updateProductGroupsAttrValue(ProductGroupEvent $productGroupEvent)

Update Product groups when event is dispatched

updateProductGroupsCategory(ProductGroupEvent $productGroupEvent)

Update Product groups when event is dispatched

bool
shouldUpdateProductGroup(ProductGroup $productGroup)

Determines if group should be updated

editProductGroup(ProductGroup $productGroup, mixed $id)

Edit ProductGroup entity

editGroupDiscounts(mixed $id, array $data)

Edit only discounts for group with id

bool
sortGroups(int $id, int $newIndex)

Change priority of Product Groups

mixed
getLoggedUsername()

Get username of logged in user

mixed
getLoggedUser()

Get logged in user

mixed
hasRoleAdmin()

Checks if current user has ADMIN role

getCheckoutManager()

Get checkout manager

string
getCurrentLocale()

Get current locale string

dispatchProductGroupUserReCacheEvent()

Dispatches re cache event

bool|string
saveMultiple(array $newGroups, array $updatedGroups)

Save multiple groups

bool
deleteProductGroupsAfterSync(array $groupsToSave, array $additionalParams = [])

Delete multiple product groups that are not in array

array
findGroupsByName(string $name)

Find groups by name, wildcard can be used

Details

in JQGridManagerTrait at line 26
mixed searchForJQGRID(array $searchParams, array $sortParams = array(), array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

Parameters

array $searchParams
array $sortParams
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

mixed

in JQGridManagerTrait at line 40
mixed findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

Parameters

int $page
int $offset
array $sortParams
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

mixed

in JQGridManagerTrait at line 53
mixed getCountForJQGRID(array|null $searchParams = null, array|null $sortParams = null, array|null $additionalParams = array(), JQGridWrapper|null $jqGridWrapper = null)

Parameters

array|null $searchParams
array|null $sortParams
array|null $additionalParams
JQGridWrapper|null $jqGridWrapper

Return Value

mixed

at line 656
getEntitiesForBlockElementsExtension($ids)

Parameters

$ids

array getEntityNamesForIds(array $ids)

Get id and name of entity

Parameters

array $ids

Return Value

array

at line 60
__construct(ProductGroupRepository $repository, ProductManager $productManager, ContainerInterface $container)

Parameters

ProductGroupRepository $repository
ProductManager $productManager
ContainerInterface $container

at line 74
ProductGroup getReference(mixed $id)

Get reference to Product Group class

Parameters

mixed $id

Return Value

ProductGroup

at line 88
ProductGroup|null findByPk(mixed $id)

Get Product Group by id

Parameters

mixed $id

Return Value

ProductGroup|null

Exceptions

NonUniqueResultException

at line 100
bool deleteProductGroups(array $ids)

Delete multiple Product Groups

Parameters

array $ids

Return Value

bool FALSE on error, TRUE otherwise

at line 111
mixed getAllGroupsFromCache()

Get all product group data from cache, in there is no cached data cache it

Return Value

mixed

at line 123
reCacheAllGroups()

Set product groups to cache

at line 135
array getProductGroupsArray(array $ids)

Get array of Product Groups for ids

Parameters

array $ids

Return Value

array

at line 149
ProductGroup handlePersist(ProductGroup $productGroup)

Save new Product Group entity

Parameters

ProductGroup $productGroup

Return Value

ProductGroup

Exceptions

NonUniqueResultException

at line 223
updateProductGroups(ProductGroupEvent $productGroupEvent)

Parameters

ProductGroupEvent $productGroupEvent

at line 240
updateProductGroupsAttrValue(ProductGroupEvent $productGroupEvent)

Update Product groups when event is dispatched

Parameters

ProductGroupEvent $productGroupEvent

at line 303
updateProductGroupsCategory(ProductGroupEvent $productGroupEvent)

Update Product groups when event is dispatched

Parameters

ProductGroupEvent $productGroupEvent

at line 356
bool shouldUpdateProductGroup(ProductGroup $productGroup)

Determines if group should be updated

Parameters

ProductGroup $productGroup

Return Value

bool

at line 372
ProductSearchWrapper createSearchWrapperFromProductGroup(ProductGroup $productGroup)

Create <a href="/.

./../../../Model/ProductBundle/Entity/ProductSearchWrapper.html">ProductSearchWrapper based on product group

Parameters

ProductGroup $productGroup

Return Value

ProductSearchWrapper

at line 429
ProductGroup editProductGroup(ProductGroup $productGroup, mixed $id)

Edit ProductGroup entity

Parameters

ProductGroup $productGroup
mixed $id

Return Value

ProductGroup

Exceptions

NonUniqueResultException

at line 530
ProductGroup editGroupDiscounts(mixed $id, array $data)

Edit only discounts for group with id

Parameters

mixed $id
array $data

Return Value

ProductGroup

Exceptions

NonUniqueResultException

at line 565
bool sortGroups(int $id, int $newIndex)

Change priority of Product Groups

Parameters

int $id
int $newIndex

Return Value

bool TRUE on success, FALSE on failure

Exceptions

DBALException
NonUniqueResultException

at line 575
mixed getLoggedUsername()

Get username of logged in user

Return Value

mixed

at line 585
mixed getLoggedUser()

Get logged in user

Return Value

mixed

at line 595
mixed hasRoleAdmin()

Checks if current user has ADMIN role

Return Value

mixed

at line 604
CheckoutManager getCheckoutManager()

Get checkout manager

Return Value

CheckoutManager

at line 614
string getCurrentLocale()

Get current locale string

Return Value

string

at line 622
dispatchProductGroupUserReCacheEvent()

Dispatches re cache event

at line 635
bool|string saveMultiple(array $newGroups, array $updatedGroups)

Save multiple groups

Parameters

array $newGroups
array $updatedGroups

Return Value

bool|string TRUE on success else error string

at line 648
bool deleteProductGroupsAfterSync(array $groupsToSave, array $additionalParams = [])

Delete multiple product groups that are not in array

Parameters

array $groupsToSave
  • Delete all groups that are not in this array
array $additionalParams
  • Additional parameters

Return Value

bool

at line 673
array findGroupsByName(string $name)

Find groups by name, wildcard can be used

Parameters

string $name

Return Value

array