ChangedPriceRepository
class ChangedPriceRepository extends EntityRepository
Class ChangedPriceRepository is injected as empire_changed_price_plugin.changed_price_repository service. ChangedPriceRepository is used for crud operation for entity.
Use this class to work with database.
Traits
Constants
| ALIAS |
Alias for entity |
| USER_ALIAS |
Alias for user entity DON'T CHANGE THIS |
| PRODUCT_ALIAS |
Alias for product entity DON'T CHANGE THIS |
| SIMPLE_PRODUCT_ALIAS |
Alias for simple product entity |
| ATTR_VAL_ALIAS |
Alias for product attribute value entity |
| VAL_ALIAS |
Alias for attribute value entity |
Methods
Should contain group by which jqgrid uses.
JQGrid function
JQGrid function
No description
Find all products that provided user is watching
Remove watchlist item that match provided user and product
Find all users with products in watchlist
Check if product is already added in watchlist for provided user
Update old price field
Count number of products in watchlist for provided user
This is custom count query because we need to count [USER/PRODUCT].id instead of self::ALIAS.id This is only used here, every other query should just count self::ALIAS.id
No description
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
at line 76
ChangedPrice|object
getReference(string $entityName, int $id)
at line 88
array
getWatchlistForUser(int $userId)
Find all products that provided user is watching
at line 134
ChangedPrice
addToWatchList(ChangedPrice $changedPrice)
Add new product to watchlist
at line 166
bool
removeAllItemsFromWatchList(User $user)
Removing all items from watchlist for provided user
at line 191
bool
removeFromWatchList(int $userId, int $productId, int $attrValId)
Remove watchlist item that match provided user and product
at line 227
array
getUsersWithProductInWatchlist(int $productId, mixed $attrVal, Pricelist|null $priceList = null)
Find all users with products in watchlist
at line 260
int|null
searchProductForFrontend(int $userId, int $productId, int $attrValId)
Check if product is already added in watchlist for provided user
at line 289
bool
updateOldPriceForProduct(mixed $productId, mixed $attrValId, float $oldPrice, Pricelist|null $priceList = null)
Update old price field
at line 317
array
countProductsInWatchlist(int $userId)
Count number of products in watchlist for provided user
at line 341
mixed
getCountForJQGRIDCustom(array|null $searchParams, array|null $sortParams, true $isCountSearch, array|null $additionalParams, JQGridWrapper|null $jqGridWrapper)
This is custom count query because we need to count [USER/PRODUCT].id instead of self::ALIAS.id This is only used here, every other query should just count self::ALIAS.id