class ChangedPriceManager implements BasicEntityManagerInterface

Class ChangedPriceManager is injected as empire_changed_price_plugin.changed_price_manager service. ChangedPriceManager handles the logic for managed entity.

Traits

Trait JQGridManagerTrait

Properties

protected ChangedPriceRepository $repository
protected ChangedPriceEventContainer $eventContainer

Methods

mixed
searchForJQGRID(array $searchParams, array $sortParams = array(), array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

No description

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

No description

mixed
getCountForJQGRID(array|null $searchParams = null, array|null $sortParams = null, array|null $additionalParams = array(), JQGridWrapper|null $jqGridWrapper = null)

No description

__construct(ChangedPriceRepository $repository, ChangedPriceEventContainer $eventContainer)

WishlistManager constructor.

array|false
getWatchlistForUser()

Find all products in watchlist for logged user

array
getWatchlistForUserBackend(int $userId)

Find all products that provided user is watching

addToWatchlist(int $productId, int $attrValId)

Add new watchlist item to logged user

bool
removeProductFromWatchlist(int $productId, int $attrValId)

Remove watchlist item that match provided product for logged user

bool
removeAllProductFromWatchlist()

Removing all items from watchlist for provided user

mixed
searchProductForFrontend(int $productId, int $attrValId)

Check if product is already added in watchlist for logged user

sendNotificationToUser(ProductChangedPriceEvent $event)

Check if price is changed for product(parameter 'oldPrice' in params array) and send notification for user who watch only that product Check if price is changed for product attribute values(iterates over 'oldAttrCost') and send notification for those pav's who's price is changed

updateOldPriceForProduct(ChangedPriceUpdateEvent $event)

Update old price field

bool|int
countProductsInWatchlist()

Count number of products in watchlist for logged user

array
loadDataForOlap()

No description

Details

in JQGridManagerTrait at line 26
mixed searchForJQGRID(array $searchParams, array $sortParams = array(), array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

Parameters

array $searchParams
array $sortParams
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

mixed

in JQGridManagerTrait at line 40
mixed findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

Parameters

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

Return Value

mixed

at line 250
mixed getCountForJQGRID(array|null $searchParams = null, array|null $sortParams = null, array|null $additionalParams = array(), JQGridWrapper|null $jqGridWrapper = null)

Parameters

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

Return Value

mixed

at line 48
__construct(ChangedPriceRepository $repository, ChangedPriceEventContainer $eventContainer)

WishlistManager constructor.

Parameters

ChangedPriceRepository $repository
ChangedPriceEventContainer $eventContainer

at line 59
array|false getWatchlistForUser()

Find all products in watchlist for logged user

Return Value

array|false

at line 79
array getWatchlistForUserBackend(int $userId)

Find all products that provided user is watching

Parameters

int $userId

Return Value

array

at line 95
ChangedPrice addToWatchlist(int $productId, int $attrValId)

Add new watchlist item to logged user

Parameters

int $productId
int $attrValId

Return Value

ChangedPrice

Exceptions

NonUniqueResultException
ORMException

at line 129
bool removeProductFromWatchlist(int $productId, int $attrValId)

Remove watchlist item that match provided product for logged user

Parameters

int $productId
int $attrValId

Return Value

bool

Exceptions

NoResultException
NonUniqueResultException

at line 146
bool removeAllProductFromWatchlist()

Removing all items from watchlist for provided user

Return Value

bool

at line 167
mixed searchProductForFrontend(int $productId, int $attrValId)

Check if product is already added in watchlist for logged user

Parameters

int $productId
int $attrValId

Return Value

mixed

Exceptions

Exception

at line 182
sendNotificationToUser(ProductChangedPriceEvent $event)

Check if price is changed for product(parameter 'oldPrice' in params array) and send notification for user who watch only that product Check if price is changed for product attribute values(iterates over 'oldAttrCost') and send notification for those pav's who's price is changed

Parameters

ProductChangedPriceEvent $event

at line 221
updateOldPriceForProduct(ChangedPriceUpdateEvent $event)

Update old price field

Parameters

ChangedPriceUpdateEvent $event

at line 231
bool|int countProductsInWatchlist()

Count number of products in watchlist for logged user

Return Value

bool|int

at line 258
array loadDataForOlap()

Return Value

array