class ProductGroupRepository extends EntityRepository implements AbstractBlockElementRepositoryInterface

Class ProductGroupRepository is injected as alligator.product.group.repository service. ProductGroupRepository is used for crud operation for entity.

Use this class to work with database.

Traits

Trait JQGridTrait

Constants

ALIAS

Alias for main entity

Methods

jQGridJoinFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)

All joins used in select.

jQGridGroupByFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)

Should contain group by which jqgrid uses.

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

JQGrid function

array
searchForJQGRID(array $searchParams, array $sortParams, bool $isCountSearch = false, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

JQGrid function

array
getAllGroups()

Get all product groups

getReference(mixed $id)

Get reference to Product Group class

findByPk(mixed $id)

Get Product Group by id

array
getProductGroupsArray(array $ids)

Get array of Product Groups for ids

edit(ProductGroup $productGroup)

Edit ProductGroup entity

save(ProductGroup $productGroup)

Save new Product Group entity

mixed
delete(ProductGroup $productGroup)

Delete single Product Group

bool
deleteCollection(array $productGroups)

Delete multiple Product Groups

array
findAllGroupsWithProducts()

Get all Product Groups that are active and have valid from and to dates

bool
changeOrder(int $id, int $newIndex)

Change priority of Product Groups

int
getGroupsCount()

Get Product Groups count

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

Save multiple groups

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

Delete multiple product groups

array
getEntitiesForBlockElementsExtension(array $ids)

No description

array
getEntityNamesForIds(array $ids)

No description

array
findGroupsByName(string $name)

Find groups by name, wildcard can be used

Details

in JQGridTrait at line 27
jQGridJoinFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)

All joins used in select.

Override in the repository class if needed. Should do nothing otherwise

Parameters

QueryBuilder $qb
JQGridWrapper $jqGridWrapper

in JQGridTrait at line 42
jQGridGroupByFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)

Should contain group by which jqgrid uses.

Override in the repository class if needed. Should do nothing otherwise

Parameters

QueryBuilder $qb
JQGridWrapper $jqGridWrapper

in JQGridTrait at line 61
array findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams, JQGridWrapper $jqGridWrapper)

JQGrid function

Parameters

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

Return Value

array

in JQGridTrait at line 94
array searchForJQGRID(array $searchParams, array $sortParams, bool $isCountSearch = false, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

JQGrid function

Parameters

array $searchParams
array $sortParams
bool $isCountSearch
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

array

at line 37
array getAllGroups()

Get all product groups

Return Value

array

at line 53
ProductGroup getReference(mixed $id)

Get reference to Product Group class

Parameters

mixed $id

Return Value

ProductGroup

Exceptions

ORMException

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

Get Product Group by id

Parameters

mixed $id

Return Value

ProductGroup|null

Exceptions

NonUniqueResultException

at line 83
array getProductGroupsArray(array $ids)

Get array of Product Groups for ids

Parameters

array $ids

Return Value

array

at line 98
ProductGroup edit(ProductGroup $productGroup)

Edit ProductGroup entity

Parameters

ProductGroup $productGroup

Return Value

ProductGroup

at line 117
ProductGroup save(ProductGroup $productGroup)

Save new Product Group entity

Parameters

ProductGroup $productGroup

Return Value

ProductGroup

at line 139
mixed delete(ProductGroup $productGroup)

Delete single Product Group

Parameters

ProductGroup $productGroup

Return Value

mixed

Exceptions

ORMException
OptimisticLockException

at line 154
bool deleteCollection(array $productGroups)

Delete multiple Product Groups

Parameters

array $productGroups

Return Value

bool FALSE on error, TRUE otherwise

at line 174
array findAllGroupsWithProducts()

Get all Product Groups that are active and have valid from and to dates

Return Value

array

at line 201
bool changeOrder(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 235
int getGroupsCount()

Get Product Groups count

Return Value

int

Exceptions

NonUniqueResultException

at line 253
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 299
bool deleteProductGroupsAfterSync(array $groupsToSave, array $additionalParams = [])

Delete multiple product groups

Parameters

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

Return Value

bool

at line 331
array getEntitiesForBlockElementsExtension(array $ids)

Parameters

array $ids

Return Value

array

at line 353
array getEntityNamesForIds(array $ids)

Parameters

array $ids

Return Value

array

at line 374
array findGroupsByName(string $name)

Find groups by name, wildcard can be used

Parameters

string $name

Return Value

array