ProductRepository
class ProductRepository extends EntityRepository implements AbstractBlockElementRepositoryInterface
Class ProductRepository is injected as alligator.product_repository service. ProductRepository is used for crud operation for managed entity.
Use this class to work with database.
Traits
Constants
| ALIAS |
Alias for product |
| PRODUCT_ATTRIBUTE_VALUES_ALIAS |
Alias for product attribute values |
| PRODUCT_ATTRIBUTE_VALUES_FEATURES_ALIAS |
Alias for product attribute values feature |
| ATTRIBUTE_VALUES_ALIAS |
Alias for attribute values |
| BRAND_ALIAS |
Alias for brand |
| PRICELIST_ITEMS_ALIAS |
Alias for price list item |
| PRICELIST_ALIAS |
Alias for price list |
| TRANSLATION_ALIAS |
Alias for product translation |
| ATTRIBUTES |
Alias for attribute |
| ATTRIBUTE_SET |
Alias for attribute set |
| JOIN_WITH_SIMPLE_PRODUCT |
Alias for simple product |
| JOIN_WITH_GROUP_PRODUCTS |
Alias for group product join |
| JOIN_WITH_GROUP_SIMPLE_PRODUCTS |
Alias for join group simple product |
| JOIN_WITH_PRICES |
Alias for join with prices |
| JOIN_WITH_CATEGORY_ALIAS |
Alias for join with category |
| JOIN_WITH_FEATURES |
Alias for join with product feature |
| LIKE_WILDCARD |
Wildcard |
| AVAILABLE_STATE |
Product status available |
| PRODUCT_TABLE_NAME |
Table name of product entity |
| SIMPLE_PRODUCT_TABLE_NAME |
Table name of simple product entity |
| SP_QUANTITY_ROW |
Simple product field (numberInStock) |
| SP_RESERVED_QUANTITY_ROW |
Simple product field (reservedQuantity) |
| SP_TOTAL_QUANTITY_ROW |
Simple product field (totalQuantity) |
| PRODUCT_SEARCH_FIELDS |
List of product fields for search |
| PRODUCT_DEFAULT_SORT_FIELD |
List of product fields for sort |
| SEARCH_COLUMNS |
List of product properties for search |
| PRODUCTS_ON_ACTION_RESULTS_KEY |
Key for caching products on action |
Methods
Should contain group by which jqgrid uses.
JQGrid function
JQGrid function
No description
No description
No description
get sql algorithm to use use when calculating price, action price, field to select action price
Flush entity manager
No description
Find products on action with pagination
Update product quantities on simple product for specific product attribute values
Find collection of products
Persist new products from array with custom id generator
Find product by erp code
Find products for provided array of ids
Find all product id, erpCode and productSearchString fields
Find all ids of attribute value, brand and category for provided array of products
Find product by id
Find product information by id
Find product by slug
Find all product for provided array of ids
Remove products from array
Persist collection of products
Start db transaction
Commit db transaction
Rollback db transaction
Persist collecion of products
Find all products slugs
Get product metadata
Get simple product metadata
Find custom product fields for export
Find product reference
Find entity reference by class name and id
Remove cached keys
Find products with brand and category for provided array of product ids
No description
Find all products on action
Find reference for array of products
Find product attribute value by product id
Find all product filters data
Delete cache for products on action page
Find all products and their attribute sets
Get product codes
Get all ids of product and simple product codes
Find all products main information
Get ids of products without price
Get ids of products without simple product
Persist collection of products with custom id
Find products by category id
Find products by category id with pagination or count them
No description
Find products for product search update
Update product isNew property
Find id of products in database for provided array of ids
Find id, productName, erpCode and sku of products with pagination or count them
Find all products prices
Find all erpCodes of products and product attribute values
Execute custom sql
Re-cache product price list items array field
Update product customProductLinks property
Find products by array of erpCode
Edit collection of products
Prevent product add to cart
Update products with custom labels
Update product rating for provided array of brands
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 AvailabilityChangeRepositoryTrait at line 24
productLimitDataDQL(QueryBuilder $qb, array $limitData)
in AvailabilityChangeRepositoryTrait at line 56
string
productLimitDataSQL(string $productAlias, array $limitData, bool $addAnd = true)
in AvailabilityChangeRepositoryTrait at line 94
brandLimitDataDQL(QueryBuilder $qb, array $limitData, string $brandAlias = null)
in ProductPriceForPricelistAndGroupTrait at line 27
array
getCustomPriceData(ProductSearchWrapper $searchWrapper)
get sql algorithm to use use when calculating price, action price, field to select action price
in ProductSearchRepositoryTrait at line 29
array
doProductSearch(ProductSearchWrapper $searchWrapper)
at line 265
flushProducts(array|null $products = null)
Flush entity manager
at line 282
PrimaryKeyInterface|int|null
save(PrimaryKeyInterface $entity)
Persist new product
at line 312
PrimaryKeyInterface|int|null
edit(PrimaryKeyInterface $entity)
Merge product
at line 339
EntityManager|EntityManagerInterface
getEM()
at line 352
array
findProductsOnAction(mixed $page, mixed $offset, array|null $limitData = null)
Find products on action with pagination
at line 408
updateQty(Product $product)
Update product quantities on simple product for specific products
at line 424
updateProductQtyAfterPAV(ProductAttributeValues $pav)
Update product quantities on simple product for specific product attribute values
at line 507
array
getGroupProductsFromDB(array $array)
Find collection of products
at line 539
ArrayCollection
saveCSV(ArrayCollection $objectList, Category $dbCategory = null, AttributeSet $dbAttributeSet = null)
Persist new products from array with custom id generator
at line 592
Product
findByErpCode(string $code)
Find product by erp code
at line 611
array
findMultipleByErpCode(array $arrayCodes)
Find products for provided array of ids
at line 624
array
findAllProductErpCodeSearchString()
Find all product id, erpCode and productSearchString fields
at line 640
array
getAttrValsForFilter(array $products)
Find all ids of attribute value, brand and category for provided array of products
at line 704
Product
getDBProductForProductPage(int $productId, array|null $limitData = null)
Find product by id
at line 750
array
getProductQuickInformation(int $productId)
Find product information by id
at line 799
Product
getDBProductBySlugForProductPage(string $productSlug, array|null $limitData = null)
Find product by slug
at line 836
array
getAllProductsFromArray(array $productsArray)
Find all product for provided array of ids
at line 852
bool|stdClass
deleteMultiple(array $products)
Remove products from array
at line 882
mixed
saveProductCollectionFromCMD(array $array, OutputInterface|null $output = null)
Persist collection of products
at line 980
startTransaction()
Start db transaction
at line 988
commitTransaction()
Commit db transaction
at line 996
rollbackTransaction()
Rollback db transaction
at line 1010
bool
saveProductsFromArray(array $arrayOfProducts, OutputInterface|null $output = null)
Persist collecion of products
at line 1094
array
getProductsSlugsNoLocale()
Find all products slugs
at line 1111
mixed
getProductMetadata()
Get product metadata
at line 1122
mixed
getSimpleProductMetadata()
Get simple product metadata
at line 1133
array
getCustomProductFieldsForExport(array $fields)
Find custom product fields for export
at line 1173
Product
getReference(int $id)
Find product reference
at line 1187
bool|Proxy|null|object
getReferenceForClass(string $className, int $id)
Find entity reference by class name and id
at line 1196
deleteQueryCache(string $key)
Remove cached keys
at line 1207
array
getAllProductsWithBrandNameAndCategoryConcatFromArray(array $productsArray)
Find products with brand and category for provided array of product ids
at line 1237
array
getEntitiesForBlockElementsExtension(array $ids, $limitData = null)
at line 1295
array
getAllProductsOnAction(array|null $limitData = null)
Find all products on action
at line 1312
array
getProductReferencesForArrayIds(array $ids)
Find reference for array of products
at line 1331
Product
getProductAttributeValues(int $productId)
Find product attribute value by product id
at line 1355
array
getAttrsForProducts(array $pavsArray, bool $includeBrands = true, null|array $attributesOrder = null, null|array $disabledAttrs = null, null|array $closures = null, ProductSearchWrapper|null $searchWrapper = null)
Find all product filters data
at line 1423
deleteProductsOnActionCache()
Delete cache for products on action page
at line 1437
array
getAllAvailableProductAndAttributeSet(array $prodArray)
Find all products and their attribute sets
at line 1459
array
getAllProductsErpCodes(array $aditionalFields = [])
Get product codes
at line 1481
array
getAllSimpleProductErpCodes()
Get all ids of product and simple product codes
at line 1496
array
getAllProductsIdAndNameDescription()
Find all products main information
at line 1515
array
getAllProductsWithoutPrice()
Get ids of products without price
at line 1530
array
getAllProductsWithoutSimpleProduct()
Get ids of products without simple product
at line 1548
bool|string
saveMultiple(array $products, int $flushNumber = 30)
Persist collection of products with custom id
at line 1578
array
getProductsByCategorySimple(int $id)
Find products by category id
at line 1610
array
getProductsByCategoryWithPaginationSimple(Category $category, int $page, int $offset, bool $count, array|null $searchParams = null)
Find products by category id with pagination or count them
at line 1665
array
getEntityNamesForIds(array $ids)
at line 1691
array
getProductsForProductSearchUpdate(array $ids, bool $isProductSearch)
Find products for product search update
at line 1733
bool
updateStatusForNewProducts(int $numberOfDays)
Update product isNew property
at line 1748
array
findProductsMissingFromDbCSVImport(array $productArray)
Find id of products in database for provided array of ids
at line 1766
array
getIdNameErpCodeOfAllProducts(array $conditions = array(), bool $count = false, int|null $page = null, int $offset = 30)
Find id, productName, erpCode and sku of products with pagination or count them
at line 1804
array
getCurrentPrices()
Find all products prices
at line 1821
updateProductViewCount(Product $product)
Increment product viewCount filed
at line 1836
array
getErpCodesOfProductAndPav()
Find all erpCodes of products and product attribute values
at line 1854
bool
doCustomSqlQuery(string $sql)
Execute custom sql
at line 1869
bool|string
reCacheProductPricelistItemsArray()
Re-cache product price list items array field
at line 1906
bool|Exception
updateProductSalesCount(DateTime $date = null)
Increment product salesCount property
at line 1938
bool|Exception
updateCustomProductLinks(array $customProductLinks)
Update product customProductLinks property
at line 1968
array
findProductsByErpCode(array $codes)
Find products by array of erpCode
at line 1989
bool
editProductsFromArray(array $array, OutputInterface $output)
Edit collection of products
at line 2036
updatePreventDirectAddToCartField()
Prevent product add to cart
at line 2054
array
getPricesForProducts(ProductSearchWrapper $searchWrapper)
Find products prices
at line 2090
boolean|Exception
updateProductsWithCustomLabels(string $label, array $productIds)
Update products with custom labels
at line 2121
bool
updateMultipleProductsRatings(float $newRating, array $brandsArray)
Update product rating for provided array of brands