ProductRelationshipManager
class ProductRelationshipManager implements BasicEntityManagerInterface, JQGridInterface
Class ProductRelationshipManager is injected as empire_product_relationship_plugin.manager service. ProductRelationshipManager handles the logic for managed entity.
Traits
Properties
| protected ProductRelationshipRepository | $repository | ||
| protected ProductRelationshipEventContainer | $container | ||
| protected ProductRelationshipName | $relationshipNameDB |
Methods
No description
No description
No description
ProductRelationshipManager constructor.
Get relationship entity for specified product and relationship name
Find product relationship name id by product relationship id
Find product relationship
Create references to foreign entities and edit product relationship
Create reference to foreign entities and save product relationship
Remove product relationships for provided array of ids
Get data for products in relationship
Get data for products in relationship
Get count of products for specified relationship
Get all relationship names
Get relationship names for specified product
Get reference to ProductRelationshipName
Find products by category id
Find categories for relationship
Edit product relationship
Save products sort in relationship
Create references to foreign entities and save or edit product relationship
Remove product from product relationship
Save or edit category products in relationship
Remove category product from relationship
Change product relationship name for relationship
Find relationship entity for specified code
Save multiple product relationships
Edit multiple product relationships
Delete multiple product relationships
Delete all product relationships where erp code is not in specified array
Delete all product relationships for provided array of erp codes
Get ids of products for specified relationships
Import product relationships from CSV file This is only import for relationships that have main product TO DO (import without main product)
Details
in JQGridManagerTrait at line 26
mixed
searchForJQGRID(array $searchParams, array $sortParams = array(), array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)
in JQGridManagerTrait at line 40
mixed
findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)
in JQGridManagerTrait at line 53
mixed
getCountForJQGRID(array|null $searchParams = null, array|null $sortParams = null, array|null $additionalParams = array(), JQGridWrapper|null $jqGridWrapper = null)
at line 59
__construct(ProductRelationshipRepository $repository, ProductRelationshipEventContainer $container)
ProductRelationshipManager constructor.
at line 72
ProductRelationship|bool
getRelationshipForProductId(int $productId, string $relationshipName)
Get relationship entity for specified product and relationship name
at line 83
int
getRelationshipNameForRelationship(int $id)
Find product relationship name id by product relationship id
at line 94
ProductRelationship
findOneById(int $id)
Find product relationship
at line 105
ProductRelationship|bool|PrimaryKeyInterface
editProductRelationship(ProductRelationship $productRelationship)
Create references to foreign entities and edit product relationship
at line 164
ProductRelationship|PrimaryKeyInterface
saveNewRelationshipWithoutMainProduct(int $relationshipNameId)
Create reference to foreign entities and save product relationship
at line 178
bool
deleteProductCrossRelationships(array $ids)
Remove product relationships for provided array of ids
at line 189
array
doProductSearch(ProductSearchWrapper $searchWrapper)
Search for products
at line 210
array
getProductsByRelationshipAndProductWithPagination(int $productId, int $relationshipNameId, int $relationshipId, int $page, int $offset, null $searchParams = null, array|null $sortParams = null, bool $isCount = false)
Get data for products in relationship
at line 240
array
getRelationshipPagination(int $relationshipId, int $productId, int $page = 1, int $offset = 4)
Get data for products in relationship
at line 258
array
getRelationshipPaginationCount(int $relationshipId, int $productId)
Get count of products for specified relationship
at line 270
array
getRelationshipNames()
Get all relationship names
at line 281
array
getRelationshipNamesForProduct(int $id)
Get relationship names for specified product
at line 296
ProductRelationshipName
getRelationshipNameReference(int $id)
Get reference to ProductRelationshipName
at line 307
array
getProductsForCategory(int $id)
Find products by category id
at line 320
array|bool
getCategoriesForRelationship(int $relationshipId, int $productId, int $relationshipNameId)
Find categories for relationship
at line 334
mixed
editProductRelationshipOrder(int $relationshipId, int $relationshipNameId, int $mainProductId, array $products)
Edit product relationship
at line 377
bool
sortProductsInRelationship(int $productRelationshipProductId, int $mainProductId, int $relationshipNameId, ProductRelationship|bool $relationship, int $newIndex)
Save products sort in relationship
at line 401
bool|PrimaryKeyInterface
saveProductToRelationship(int $relationshipId, int $relationshipNameId, int $mainProductId, int $productId)
Create references to foreign entities and save or edit product relationship
at line 452
bool
removeProductFromRelationship(int $relationshipId, int $relationshipNameId, int $mainProductId, int $productRelationshipProductId)
Remove product from product relationship
at line 497
array|bool
saveCategoryProductsToRelationship(int $relationshipId, int $relationshipNameId, int $mainProductId, int $categoryId)
Save or edit category products in relationship
at line 561
array|bool|PrimaryKeyInterface
removeCategoryProductsFromRelationship(int $relationshipId, int $relationshipNameId, int $mainProductId, int $categoryId)
Remove category product from relationship
at line 622
PrimaryKeyInterface
changeProductRelationshipNameForRelationship(int $relationshipId, int $relationshipNameId)
Change product relationship name for relationship
at line 638
array
getRelationshipByErCode(string $code)
Find relationship entity for specified code
at line 649
bool|string
saveMultiple(array $relationships)
Save multiple product relationships
at line 660
bool|string
updateMultiple(array $relationships)
Edit multiple product relationships
at line 671
bool|string
deleteMultipleByIds(array $ids)
Delete multiple product relationships
at line 685
bool
deleteProductRelationshipsWithErpCodeNOT(array $erpCodes, string $relationship)
Delete all product relationships where erp code is not in specified array
at line 696
bool|string
deleteMultipleByErpCode(array $ids)
Delete all product relationships for provided array of erp codes
at line 713
array
getProductIdsForRelationship(int $relationshipId, int $productId, int $page = 1, int $offset = 4, bool $concatResult = false)
Get ids of products for specified relationships
at line 733
int
importProductsRelationshipsFromCSV(mixed $base64Content, mixed $relationshipNameId, mixed $fileName = '')
Import product relationships from CSV file This is only import for relationships that have main product TO DO (import without main product)