ProductRelationshipRepository
class ProductRelationshipRepository extends EntityRepository
Class ProductRelationshipRepository is injected as empire_product_relationship_plugin.repository service. ProductRelationshipRepository is used for crud operation for entity.
Use this class to work with database.
Traits
Constants
| ALIAS |
Alias for main entity |
| PRODUCT_RELATIONSHIP_PRODUCT_ALIAS |
Alias for product relationship product table |
| MAIN_PRODUCT_ALIAS |
Alias for main product |
| PRODUCT_ALIAS |
Alias for product |
| CATEGORY_ALIAS |
Alias for category |
| CATEGORY_PRODUCTS |
Alias for category product |
| RELATIONSHIP_NAME_ALIAS |
Alias for relationship name |
Methods
Should contain group by which jqgrid uses.
JQGrid function
JQGrid function
Delete multiple PrimaryKeyInterface entities by array of ids
Delete multiple PrimaryKeyInterface entities by values of field
Get reference to class
Save multiple entities
Edit multiple entities
Delete multiple enities
Get reference
Get relationship entity for specified product and relationship name
Sorts products within single relationship
Update product priorities within relationship after delete
Update all product priorities after precified index
Delete all product relationships where erp code is not in specified array
Get ids of products for specified relationships
Get data for products in relationship
Get data for products in relationship when there is no main product
Get count of products for specified relationship
Get count for pagination without main products
Find categories for relationship
Get maximal priority for relationship
Get relationship entity for specified code
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
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
in JQGridTrait at line 61
array
findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams, JQGridWrapper $jqGridWrapper)
JQGrid function
in JQGridTrait at line 94
array
searchForJQGRID(array $searchParams, array $sortParams, bool $isCountSearch = false, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)
JQGrid function
in BaseRepositoryTrait at line 27
PrimaryKeyInterface
save(PrimaryKeyInterface $object)
Save PrimaryKeyInterface entity
in BaseRepositoryTrait at line 48
PrimaryKeyInterface
edit(PrimaryKeyInterface $object)
Edit PrimaryKeyInterface entity
in BaseRepositoryTrait at line 69
bool
remove(PrimaryKeyInterface $object)
Delete PrimaryKeyInterface entity
in BaseRepositoryTrait at line 88
boolean
deleteMultipleByIds(array $ids)
Delete multiple PrimaryKeyInterface entities by array of ids
in BaseRepositoryTrait at line 101
boolean|string
deleteMultipleByField(string $field, array $values)
Delete multiple PrimaryKeyInterface entities by values of field
in BaseRepositoryTrait at line 130
mixed
getReference(int $id, string|null $class = null)
Get reference to class
in BaseRepositoryTrait at line 143
bool|string
saveMultiple(array $elements, int $flushNumber = 30)
Save multiple entities
in BaseRepositoryTrait at line 178
bool|string
updateMultiple(array $elements, int $flushNumber = 30)
Edit multiple entities
in BaseRepositoryTrait at line 213
bool|string
deleteMultiple(array $elements, int $flushNumber = 30)
Delete multiple enities
at line 78
bool|Proxy|null|object
getReferenceForEntity(mixed $class, int $id)
Get reference
at line 90
ProductRelationship|bool
getRelationshipForProductId(int $productId, string $relationshipName)
Get relationship entity for specified product and relationship name
at line 129
bool
sortProductsInRelationship(int $productRelationshipProductId, int $relationshipId, int $newIndex)
Sorts products within single relationship
at line 165
bool
updatePrioritiesAfterDeletingCategory(mixed $relationshipId, mixed $deletedProductsIds)
Update product priorities within relationship after delete
at line 190
bool
deleteProductRelationshipProduct(mixed $oldIndex, mixed $relationshipId)
Update all product priorities after precified index
at line 216
bool
deleteProductRelationshipsWithErpCodeNOT(array $erpCodes, string $relationship)
Delete all product relationships where erp code is not in specified array
at line 247
array
getProductIdsForRelationship(mixed $relationshipId, mixed $productId, mixed $page, mixed $offset, bool $withoutMainProduct = false, bool $concatResult = false)
Get ids of products for specified relationships
at line 300
array
getRelationshipPagination(int $relationshipId, int $productId, int $page, int $offset, bool $withoutMainProduct = false, bool $showUnavailable = false, array|null $searchParams = null, array|null $sortParams = null)
Get data for products in relationship
at line 406
array
getRelationshipPaginationWithoutMain(mixed $relationshipId, mixed $productId, mixed $page, mixed $offset, array|null $searchParams = null, array|null $sortParams = null)
Get data for products in relationship when there is no main product
at line 489
array
getRelationshipPaginationCount(int $relationshipId, int $productId, bool $withoutMainProduct = false, bool $showUnavailable = false, array|null $searchParams = null)
Get count of products for specified relationship
at line 534
mixed
getRelationshipPaginationCountWithoutMain(int $relationshipId, int $productId, array|null $searchParams = null)
Get count for pagination without main products
at line 565
array|bool
getCategoriesForRelationship(int $relationshipId, int $productId, int $relationshipNameId)
Find categories for relationship
at line 605
mixed
getMaxPriorityForRelationship(int $relationshipNameId, int $productId, int $relationshipId)
Get maximal priority for relationship
at line 639
array
getRelationshipByErCode(string $code)
Get relationship entity for specified code