class BuyXGetYExtension extends Twig_Extension

Class BuyXGetYExtension is injected as empire_buy_x_get_y_plugin.twig_extension service. BuyXGetYExtension handles the logic and provides necessary data for managed entity in twig.

Properties

protected BuyXManager $manager

Methods

__construct(BuyXManager $manager)

BuyXGetYExtension constructor.

getFunctions()

{@inheritdoc}

array
getAllBuyXGetYOffers()

Find all buy x get y offers

array
getBuyXGetYOfferForProduct(int $id)

Find buy x get y offer for specific product

mixed
getEntitiesForBlockElementsExtension(array $ids)

Find all buy x offers for provided array of ids

string
getName()

Returns the name of the extension.

Details

at line 34
__construct(BuyXManager $manager)

BuyXGetYExtension constructor.

Parameters

BuyXManager $manager

at line 42
getFunctions()

{@inheritdoc}

at line 59
array getAllBuyXGetYOffers()

Find all buy x get y offers

Return Value

array

See also

BuyX
BuyXQuantity
GetY

at line 79
array getBuyXGetYOfferForProduct(int $id)

Find buy x get y offer for specific product

Parameters

int $id

Return Value

array

See also

BuyX
BuyXQuantity
GetY
Product

at line 98
mixed getEntitiesForBlockElementsExtension(array $ids)

Find all buy x offers for provided array of ids

Parameters

array $ids

Return Value

mixed

See also

BuyX
BuyXQuantity
GetY

at line 108
string getName()

Returns the name of the extension.

Return Value

string The extension name