class BuyXManager implements BasicEntityManagerInterface

Class BuyXManager is injected as empire_buy_x_get_y_plugin.buy_x_manager service. BuyXManager handles the logic for managed entity.

Traits

Trait JQGridManagerTrait
Class BlockElementManagerTrait. Handles reading data for block elements

Properties

protected BuyXRepository $repository
protected BuyXGetYEventContainer $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

array
getEntitiesForBlockElementsExtension(array $ids)

Get entities from database by ids

array
getEntityNamesForIds(array $ids)

Get id and name of entity

__construct(BuyXRepository $repository, BuyXGetYEventContainer $eventContainer)

GetXManager constructor.

save(BuyX $entity)

Create references to all foreign entities, persist new buy x offer and clear cache

edit(BuyX $entity)

Create references to all foreign entities, merge buy x offer and clear cache

bool
removeFromArray(array $array)

Remove bux offer provided by array

array
getProductsByNameJSON(string $nameString, int $page, int $offset)

Find products by name as search parameter

mixed
getOfferForEdit(int $id)

Find bux offer by id

array
getAllOffersForFrontEnd()

Find all buy x offers and format

array
getOfferForProductPage(int $id)

Find buy x offer by id

array
getProductsForDiscount(int $id)

Find all buy x and get y products for provided id

Product|null
getProductAttributeValues(int $productId)

Find product attribute values by product id

int|float
getGiftItemPrice(string $currency)

If product is a gift it should have some symbolic price You are not allowed to gift product so price is something like 1 RSD

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

in JQGridManagerTrait at line 53
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

array getEntitiesForBlockElementsExtension(array $ids)

Get entities from database by ids

Parameters

array $ids

Return Value

array

array getEntityNamesForIds(array $ids)

Get id and name of entity

Parameters

array $ids

Return Value

array

at line 46
__construct(BuyXRepository $repository, BuyXGetYEventContainer $eventContainer)

GetXManager constructor.

Parameters

BuyXRepository $repository
BuyXGetYEventContainer $eventContainer

at line 60
BuyX save(BuyX $entity)

Create references to all foreign entities, persist new buy x offer and clear cache

Parameters

BuyX $entity

Return Value

BuyX

Exceptions

ORMException

at line 92
BuyX edit(BuyX $entity)

Create references to all foreign entities, merge buy x offer and clear cache

Parameters

BuyX $entity

Return Value

BuyX

Exceptions

ORMException

at line 164
bool removeFromArray(array $array)

Remove bux offer provided by array

Parameters

array $array

Return Value

bool

at line 177
array getProductsByNameJSON(string $nameString, int $page, int $offset)

Find products by name as search parameter

Parameters

string $nameString
int $page
int $offset

Return Value

array

at line 191
mixed getOfferForEdit(int $id)

Find bux offer by id

Parameters

int $id

Return Value

mixed

Exceptions

NoResultException
NonUniqueResultException

at line 200
array getAllOffersForFrontEnd()

Find all buy x offers and format

Return Value

array

at line 247
array getOfferForProductPage(int $id)

Find buy x offer by id

Parameters

int $id

Return Value

array

at line 258
array getProductsForDiscount(int $id)

Find all buy x and get y products for provided id

Parameters

int $id

Return Value

array

at line 269
Product|null getProductAttributeValues(int $productId)

Find product attribute values by product id

Parameters

int $productId

Return Value

Product|null

at line 281
int|float getGiftItemPrice(string $currency)

If product is a gift it should have some symbolic price You are not allowed to gift product so price is something like 1 RSD

Parameters

string $currency

Return Value

int|float