class EmpireUserCouponExtension extends Twig_Extension

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

Methods

__construct(CouponManager $couponManager)

EmpireUserCouponExtension constructor.

getFunctions()

{@inheritdoc}

int|array
getActiveCouponsCountForUser()

Count all active coupons for logged user

array
getCouponLists()

Find all coupons for user by id

array
getCouponDiscountForOrder(string $couponCode)

Get discount for provided coupon

string
getName()

Returns the name of the extension.

Details

at line 33
__construct(CouponManager $couponManager)

EmpireUserCouponExtension constructor.

Parameters

CouponManager $couponManager

at line 41
getFunctions()

{@inheritdoc}

at line 54
int|array getActiveCouponsCountForUser()

Count all active coupons for logged user

Return Value

int|array

at line 63
array getCouponLists()

Find all coupons for user by id

Return Value

array

at line 80
array getCouponDiscountForOrder(string $couponCode)

Get discount for provided coupon

Parameters

string $couponCode

Return Value

array

Exceptions

NonUniqueResultException

at line 92
string getName()

Returns the name of the extension.

Return Value

string The extension name