class GroupProductRepository extends TranslatableRepository

Class GroupProductRepository is injected as alligator.group.product_repository service. GroupProductRepository is used for crud operation for managed entity.

Use this class to work with database.

Constants

TRANSLATION_WALKER_HINT

ALIAS

Alias for group product

ATTRIBUTES

Alias for attribute

ATTRIBUTE_SET

Alias for attribute set

JOIN_WITH_PRODUCT

Alias for join with product

JOIN_WITH_PRODUCT_ATTR_VALUE

Alis for join with product attribute values

JOIN_WITH_GROUP_SIMPLE_PRODUCT_AGGREGATION

Alias for join with group simple product

JOIN_WITH_SIMPLE_PRODUCT

Alias for join with simple product

JOIN_VALUES

Alias for join with attribute values

Properties

protected string $defaultLocale from TranslatableRepository

Methods

setDefaultLocale(string $locale)

Sets default locale

QueryBuilder
getOneOrNullResult(QueryBuilder $qb, string $locale = null, string $hydrationMode = null)

Returns translated one (or null if not found) result for given locale

mixed
getResult(QueryBuilder $qb, string $locale = null, int $hydrationMode = AbstractQuery::HYDRATE_OBJECT)

Returns translated results for given locale

array
getArrayResult(QueryBuilder $qb, string $locale = null)

Returns translated array results for given locale

QueryBuilder
getSingleResult(QueryBuilder $qb, string $locale = null, string $hydrationMode = null)

Returns translated single result for given locale

array
getScalarResult(QueryBuilder $qb, string $locale = null)

Returns translated scalar result for given locale

QueryBuilder
getSingleScalarResult(QueryBuilder $qb, string $locale = null)

Returns translated single scalar result for given locale

remove(mixed $entity)

Remove entity

bool
removeArray(array $arrayOfEntities)

Remove entities provided as array

edit(PrimaryKeyInterface $entity)

Sets default locale to entity and merge

mixed
getAll()

Find all entities depending on locale

mixed
getByPrimaryKey(PrimaryKeyInterface $entity)

Find entity by primary key

QueryBuilder
getById(int $id)

Find entity by id

QueryBuilder|array
getGroupFromDB(array $array)

Find group od entities

EntityManager
getManager()

Singleton

mixed
saveCollection(array $array)

Persist collection

array
getLanguagesForIds(array $ids)

Find all locales for custom ids of entities

Query
getTranslatedQuery(QueryBuilder $qb, string $locale = null)

Returns translated Doctrine query instance

startTransaction()

Begins transaction over database

commitTransaction()

Commit transaction over database

rollbackTransaction()

Rollback transaction over database

string
getAlias()

No description

saveBundleProduct(GroupProduct $bundleProduct)

Persist new bundle product

getGroupProductById(int $id)

Find group product by id

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

array
findGroupProductsWhichContainsProduct(int $productId)

Find group product with all related products by related product id

editBundleProduct(GroupProduct $bundleProduct)

Merge group product

deleteGroupProduct(GroupProduct $groupProduct)

Remove group product

editMultiple(array $productArray)

Merge array of group products

Details

setDefaultLocale(string $locale)

Sets default locale

Parameters

string $locale

QueryBuilder getOneOrNullResult(QueryBuilder $qb, string $locale = null, string $hydrationMode = null)

Returns translated one (or null if not found) result for given locale

Parameters

QueryBuilder $qb A Doctrine query builder instance
string $locale A locale name
string $hydrationMode A Doctrine results hydration mode

Return Value

QueryBuilder

Exceptions

NonUniqueResultException

mixed getResult(QueryBuilder $qb, string $locale = null, int $hydrationMode = AbstractQuery::HYDRATE_OBJECT)

Returns translated results for given locale

Parameters

QueryBuilder $qb A Doctrine query builder instance
string $locale A locale name
int $hydrationMode A Doctrine results hydration mode

Return Value

mixed

array getArrayResult(QueryBuilder $qb, string $locale = null)

Returns translated array results for given locale

Parameters

QueryBuilder $qb A Doctrine query builder instance
string $locale A locale name

Return Value

array

in TranslatableRepository at line 102
QueryBuilder getSingleResult(QueryBuilder $qb, string $locale = null, string $hydrationMode = null)

Returns translated single result for given locale

Parameters

QueryBuilder $qb A Doctrine query builder instance
string $locale A locale name
string $hydrationMode A Doctrine results hydration mode

Return Value

QueryBuilder

Exceptions

NoResultException
NonUniqueResultException

in TranslatableRepository at line 115
array getScalarResult(QueryBuilder $qb, string $locale = null)

Returns translated scalar result for given locale

Parameters

QueryBuilder $qb A Doctrine query builder instance
string $locale A locale name

Return Value

array

in TranslatableRepository at line 130
QueryBuilder getSingleScalarResult(QueryBuilder $qb, string $locale = null)

Returns translated single scalar result for given locale

Parameters

QueryBuilder $qb A Doctrine query builder instance
string $locale A locale name

Return Value

QueryBuilder

Exceptions

NonUniqueResultException

in TranslatableRepository at line 142
PrimaryKeyInterface save(PrimaryKeyInterface $entity)

Parameters

PrimaryKeyInterface $entity

Return Value

PrimaryKeyInterface

Exceptions

Exception

in TranslatableRepository at line 172
remove(mixed $entity)

Remove entity

Parameters

mixed $entity

Exceptions

Exception

in TranslatableRepository at line 200
bool removeArray(array $arrayOfEntities)

Remove entities provided as array

Parameters

array $arrayOfEntities

Return Value

bool

Exceptions

Exception

in TranslatableRepository at line 228
PrimaryKeyInterface edit(PrimaryKeyInterface $entity)

Sets default locale to entity and merge

Parameters

PrimaryKeyInterface $entity

Return Value

PrimaryKeyInterface

Exceptions

Exception

in TranslatableRepository at line 253
mixed getAll()

Find all entities depending on locale

Return Value

mixed

in TranslatableRepository at line 270
mixed getByPrimaryKey(PrimaryKeyInterface $entity)

Find entity by primary key

Parameters

PrimaryKeyInterface $entity

Return Value

mixed

Exceptions

NoResultException
NonUniqueResultException

in TranslatableRepository at line 291
QueryBuilder getById(int $id)

Find entity by id

Parameters

int $id

Return Value

QueryBuilder

Exceptions

NoResultException
NonUniqueResultException

in TranslatableRepository at line 307
QueryBuilder|array getGroupFromDB(array $array)

Find group od entities

Parameters

array $array Objects

Return Value

QueryBuilder|array

in TranslatableRepository at line 332
EntityManager getManager()

Singleton

Return Value

EntityManager

in TranslatableRepository at line 352
mixed saveCollection(array $array)

Persist collection

Parameters

array $array

Return Value

mixed

Exceptions

Exception

in TranslatableRepository at line 379
array getLanguagesForIds(array $ids)

Find all locales for custom ids of entities

Parameters

array $ids

Return Value

array

in TranslatableRepository at line 396
protected Query getTranslatedQuery(QueryBuilder $qb, string $locale = null)

Returns translated Doctrine query instance

Parameters

QueryBuilder $qb A Doctrine query builder instance
string $locale A locale name

Return Value

Query

in TranslatableRepository at line 404
protected startTransaction()

Begins transaction over database

in TranslatableRepository at line 412
protected commitTransaction()

Commit transaction over database

in TranslatableRepository at line 420
protected rollbackTransaction()

Rollback transaction over database

at line 97
string getAlias()

Return Value

string

at line 108
GroupProduct saveBundleProduct(GroupProduct $bundleProduct)

Persist new bundle product

Parameters

GroupProduct $bundleProduct

Return Value

GroupProduct

at line 125
GroupProduct getGroupProductById(int $id)

Find group product by id

Parameters

int $id

Return Value

GroupProduct

Exceptions

NoResultException
NonUniqueResultException

at line 144
GroupProduct getBundledProductsForGroupProduct(int $groupId)

Find group product with all related products by group product id

Parameters

int $groupId

Return Value

GroupProduct

Exceptions

NoResultException
NonUniqueResultException

at line 186
GroupProduct getBundleProductForProductId(int $productId)

Find group product with all related products by related product id

Parameters

int $productId

Return Value

GroupProduct

Exceptions

NoResultException
NonUniqueResultException

at line 225
array findGroupProductsWhichContainsProduct(int $productId)

Find group product with all related products by related product id

Parameters

int $productId

Return Value

array

at line 252
GroupProduct editBundleProduct(GroupProduct $bundleProduct)

Merge group product

Parameters

GroupProduct $bundleProduct

Return Value

GroupProduct

at line 264
deleteGroupProduct(GroupProduct $groupProduct)

Remove group product

Parameters

GroupProduct $groupProduct

at line 274
editMultiple(array $productArray)

Merge array of group products

Parameters

array $productArray