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

Trait JQGridTrait

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

jQGridJoinFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)

All joins used in select.

jQGridGroupByFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)

Should contain group by which jqgrid uses.

array
findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams, JQGridWrapper $jqGridWrapper)

JQGrid function

array
searchForJQGRID(array $searchParams, array $sortParams, bool $isCountSearch = false, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

JQGrid function

ChangedPrice|object
getReference(string $entityName, int $id)

No description

array
getWatchlistForUser(int $userId)

Find all products that provided user is watching

addToWatchList(ChangedPrice $changedPrice)

Add new product to watchlist

bool
removeAllItemsFromWatchList(User $user)

Removing all items from watchlist for provided user

bool
removeFromWatchList(int $userId, int $productId, int $attrValId)

Remove watchlist item that match provided user and product

array
getUsersWithProductInWatchlist(int $productId, mixed $attrVal, Pricelist|null $priceList = null)

Find all users with products in watchlist

int|null
searchProductForFrontend(int $userId, int $productId, int $attrValId)

Check if product is already added in watchlist for provided user

bool
updateOldPriceForProduct(mixed $productId, mixed $attrValId, float $oldPrice, Pricelist|null $priceList = null)

Update old price field

array
countProductsInWatchlist(int $userId)

Count number of products in watchlist for provided user

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

array
loadDataForOlap()

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

Parameters

QueryBuilder $qb
JQGridWrapper $jqGridWrapper

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

Parameters

QueryBuilder $qb
JQGridWrapper $jqGridWrapper

in JQGridTrait at line 61
array findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams, JQGridWrapper $jqGridWrapper)

JQGrid function

Parameters

int $page
int $offset
array $sortParams
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

array

in JQGridTrait at line 94
array searchForJQGRID(array $searchParams, array $sortParams, bool $isCountSearch = false, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

JQGrid function

Parameters

array $searchParams
array $sortParams
bool $isCountSearch
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

array

at line 76
ChangedPrice|object getReference(string $entityName, int $id)

Parameters

string $entityName
int $id

Return Value

ChangedPrice|object

Exceptions

ORMException

at line 88
array getWatchlistForUser(int $userId)

Find all products that provided user is watching

Parameters

int $userId

Return Value

array

at line 134
ChangedPrice addToWatchList(ChangedPrice $changedPrice)

Add new product to watchlist

Parameters

ChangedPrice $changedPrice

Return Value

ChangedPrice Saved watchlist item. New watchlist item on error

Exceptions

NonUniqueResultException

at line 166
bool removeAllItemsFromWatchList(User $user)

Removing all items from watchlist for provided user

Parameters

User $user

Return Value

bool

at line 191
bool removeFromWatchList(int $userId, int $productId, int $attrValId)

Remove watchlist item that match provided user and product

Parameters

int $userId
int $productId
int $attrValId

Return Value

bool

at line 227
array getUsersWithProductInWatchlist(int $productId, mixed $attrVal, Pricelist|null $priceList = null)

Find all users with products in watchlist

Parameters

int $productId
mixed $attrVal
Pricelist|null $priceList

Return Value

array

at line 260
int|null searchProductForFrontend(int $userId, int $productId, int $attrValId)

Check if product is already added in watchlist for provided user

Parameters

int $userId
int $productId
int $attrValId

Return Value

int|null

Exceptions

NonUniqueResultException

at line 289
bool updateOldPriceForProduct(mixed $productId, mixed $attrValId, float $oldPrice, Pricelist|null $priceList = null)

Update old price field

Parameters

mixed $productId
mixed $attrValId
float $oldPrice
Pricelist|null $priceList

Return Value

bool

at line 317
array countProductsInWatchlist(int $userId)

Count number of products in watchlist for provided user

Parameters

int $userId

Return Value

array

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

Parameters

array|null $searchParams
array|null $sortParams
true $isCountSearch
array|null $additionalParams
JQGridWrapper|null $jqGridWrapper

Return Value

mixed

at line 375
array loadDataForOlap()

Return Value

array