ProductRepository
class ProductRepository extends ProductRepository
Class ProductRepository is injected as empire_product_search_plugin.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
Find products on action with pagination
Update product quantities on simple product for specific product attribute values
Persist new products from array with custom id generator
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
Persist collection of products
Persist collecion of products
Find custom product fields for export
Find entity reference by class name and id
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
Find all products and their attribute sets
Get all ids of product and simple product codes
Find all products main information
Get ids of products without simple product
Persist collection of products with custom id
Find products by category id with pagination or count them
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 erpCodes of products and product attribute values
Re-cache product price list items array field
Update product customProductLinks property
Edit collection of products
Update products with custom labels
Update product rating for provided array of brands
Search products using filter
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)
in ProductRepository at line 265
flushProducts(array|null $products = null)
Flush entity manager
in ProductRepository at line 282
PrimaryKeyInterface|int|null
save(PrimaryKeyInterface $entity)
Persist new product
in ProductRepository at line 312
PrimaryKeyInterface|int|null
edit(PrimaryKeyInterface $entity)
Merge product
in ProductRepository at line 339
EntityManager|EntityManagerInterface
getEM()
in ProductRepository at line 352
array
findProductsOnAction(mixed $page, mixed $offset, array|null $limitData = null)
Find products on action with pagination
in ProductRepository at line 408
updateQty(Product $product)
Update product quantities on simple product for specific products
in ProductRepository at line 424
updateProductQtyAfterPAV(ProductAttributeValues $pav)
Update product quantities on simple product for specific product attribute values
in ProductRepository at line 448
Product
getProductById(Product $product)
Find product by id
in ProductRepository at line 466
Product
getProductByPrimaryKey(Product $entity)
Find product by id or slug
in ProductRepository at line 487
Product
getProductForEdit(Product $entity)
Find product by id or slug
in ProductRepository at line 507
array
getGroupProductsFromDB(array $array)
Find collection of products
in ProductRepository at line 539
ArrayCollection
saveCSV(ArrayCollection $objectList, Category $dbCategory = null, AttributeSet $dbAttributeSet = null)
Persist new products from array with custom id generator
in ProductRepository at line 592
Product
findByErpCode(string $code)
Find product by erp code
in ProductRepository at line 611
array
findMultipleByErpCode(array $arrayCodes)
Find products for provided array of ids
in ProductRepository at line 624
array
findAllProductErpCodeSearchString()
Find all product id, erpCode and productSearchString fields
in ProductRepository at line 640
array
getAttrValsForFilter(array $products)
Find all ids of attribute value, brand and category for provided array of products
in ProductRepository at line 704
Product
getDBProductForProductPage(int $productId, array|null $limitData = null)
Find product by id
in ProductRepository at line 750
array
getProductQuickInformation(int $productId)
Find product information by id
in ProductRepository at line 799
Product
getDBProductBySlugForProductPage(string $productSlug, array|null $limitData = null)
Find product by slug
in ProductRepository at line 836
array
getAllProductsFromArray(array $productsArray)
Find all product for provided array of ids
in ProductRepository at line 852
bool|stdClass
deleteMultiple(array $products)
Remove products from array
in ProductRepository at line 882
mixed
saveProductCollectionFromCMD(array $array, OutputInterface|null $output = null)
Persist collection of products
in ProductRepository at line 980
startTransaction()
Start db transaction
in ProductRepository at line 988
commitTransaction()
Commit db transaction
in ProductRepository at line 996
rollbackTransaction()
Rollback db transaction
in ProductRepository at line 1010
bool
saveProductsFromArray(array $arrayOfProducts, OutputInterface|null $output = null)
Persist collecion of products
in ProductRepository at line 1094
array
getProductsSlugsNoLocale()
Find all products slugs
in ProductRepository at line 1111
mixed
getProductMetadata()
Get product metadata
in ProductRepository at line 1122
mixed
getSimpleProductMetadata()
Get simple product metadata
in ProductRepository at line 1133
array
getCustomProductFieldsForExport(array $fields)
Find custom product fields for export
in ProductRepository at line 1173
Product
getReference(int $id)
Find product reference
in ProductRepository at line 1187
bool|Proxy|null|object
getReferenceForClass(string $className, int $id)
Find entity reference by class name and id
in ProductRepository at line 1196
deleteQueryCache(string $key)
Remove cached keys
in ProductRepository at line 1207
array
getAllProductsWithBrandNameAndCategoryConcatFromArray(array $productsArray)
Find products with brand and category for provided array of product ids
in ProductRepository at line 1237
array
getEntitiesForBlockElementsExtension(array $ids, $limitData = null)
in ProductRepository at line 1295
array
getAllProductsOnAction(array|null $limitData = null)
Find all products on action
in ProductRepository at line 1312
array
getProductReferencesForArrayIds(array $ids)
Find reference for array of products
in ProductRepository at line 1331
Product
getProductAttributeValues(int $productId)
Find product attribute value by product id
in ProductRepository 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
in ProductRepository at line 1423
deleteProductsOnActionCache()
Delete cache for products on action page
in ProductRepository at line 1437
array
getAllAvailableProductAndAttributeSet(array $prodArray)
Find all products and their attribute sets
in ProductRepository at line 1459
array
getAllProductsErpCodes(array $aditionalFields = [])
Get product codes
in ProductRepository at line 1481
array
getAllSimpleProductErpCodes()
Get all ids of product and simple product codes
in ProductRepository at line 1496
array
getAllProductsIdAndNameDescription()
Find all products main information
in ProductRepository at line 1515
array
getAllProductsWithoutPrice()
Get ids of products without price
in ProductRepository at line 1530
array
getAllProductsWithoutSimpleProduct()
Get ids of products without simple product
in ProductRepository at line 1548
bool|string
saveMultiple(array $products, int $flushNumber = 30)
Persist collection of products with custom id
in ProductRepository at line 1578
array
getProductsByCategorySimple(int $id)
Find products by category id
in ProductRepository 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
in ProductRepository at line 1665
array
getEntityNamesForIds(array $ids)
in ProductRepository at line 1691
array
getProductsForProductSearchUpdate(array $ids, bool $isProductSearch)
Find products for product search update
in ProductRepository at line 1733
bool
updateStatusForNewProducts(int $numberOfDays)
Update product isNew property
in ProductRepository at line 1748
array
findProductsMissingFromDbCSVImport(array $productArray)
Find id of products in database for provided array of ids
in ProductRepository 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
in ProductRepository at line 1804
array
getCurrentPrices()
Find all products prices
in ProductRepository at line 1821
updateProductViewCount(Product $product)
Increment product viewCount filed
in ProductRepository at line 1836
array
getErpCodesOfProductAndPav()
Find all erpCodes of products and product attribute values
in ProductRepository at line 1854
bool
doCustomSqlQuery(string $sql)
Execute custom sql
in ProductRepository at line 1869
bool|string
reCacheProductPricelistItemsArray()
Re-cache product price list items array field
in ProductRepository at line 1906
bool|Exception
updateProductSalesCount(DateTime $date = null)
Increment product salesCount property
in ProductRepository at line 1938
bool|Exception
updateCustomProductLinks(array $customProductLinks)
Update product customProductLinks property
in ProductRepository at line 1968
array
findProductsByErpCode(array $codes)
Find products by array of erpCode
in ProductRepository at line 1989
bool
editProductsFromArray(array $array, OutputInterface $output)
Edit collection of products
in ProductRepository at line 2036
updatePreventDirectAddToCartField()
Prevent product add to cart
in ProductRepository at line 2054
array
getPricesForProducts(ProductSearchWrapper $searchWrapper)
Find products prices
in ProductRepository at line 2090
boolean|Exception
updateProductsWithCustomLabels(string $label, array $productIds)
Update products with custom labels
in ProductRepository at line 2121
bool
updateMultipleProductsRatings(float $newRating, array $brandsArray)
Update product rating for provided array of brands
at line 34
QueryBuilder
searchProducts(Filter $filter, string|int $page, string|int $offset, bool $isCountSearch = false)
Search products using filter