class CouponManager implements BasicEntityManagerInterface, JQGridInterface

Class CouponManager is injected as alligator.coupon_manager service. CouponManager handles the logic for managed entity.

Properties

protected CouponRepository $couponRepository
protected CouponEventContainer $eventContainer

Methods

__construct(CouponRepository $couponRepository, CouponEventContainer $eventContainer)

CouponManager constructor.

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

Find promotions by search term with pagination

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

Find all promotions with pagination

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

Count all promotions

array
getPromotionById(int $id)

Find promotion by id

bool
removePromotionsFromArray(array $arrayOfPromotions)

Remove promotions provided by array of ids

editCoupon($content)

{@inheritdoc}

useCoupon(Coupon $coupon)

Increment coupon usage and set used to TRUE if number of uses reached usage limit

Coupon|null
getCouponById(int $id)

Find coupon by id

array
getAllCouponsForUser()

Find all coupons for user by id

int|array
getActiveCouponsCountForUser()

Count all active coupons for logged user

array
getAllCouponsForFrontendProfileView()

Find all coupon data for user

array
findAllCouponsForFrontend(int $page, int $offset, bool $active, int $userId = null)

Find all promotions for specific user with pagination

array
countAllCouponsForFrontend(bool $active, int $userId = null)

Count all promotions for specific user

array
getUsers(string $param, int $page, int $offset, array|null $arrayOfUsers = null)

Find all users email

array|mixed|null|object
getCouponDiscountForOrder(string $couponCode)

No description

Details

at line 44
__construct(CouponRepository $couponRepository, CouponEventContainer $eventContainer)

CouponManager constructor.

Parameters

CouponRepository $couponRepository
CouponEventContainer $eventContainer

at line 60
array searchForJQGRID(array $searchParams, array $sortParams = array(), array $additionalParams = array(), JQGridWrapper $JQGridWrapper = null)

Find promotions by search term with pagination

Parameters

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

Return Value

array

at line 75
array findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams = array(), JQGridWrapper $JQGridWrapper = null)

Find all promotions with pagination

Parameters

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

Return Value

array

at line 89
array getCountForJQGRID(null $searchParams = null, null $sortParams = null, array $additionalParams = array(), JQGridWrapper $JQGridWrapper = null)

Count all promotions

Parameters

null $searchParams
null $sortParams
array $additionalParams
JQGridWrapper $JQGridWrapper

Return Value

array

at line 100
array getPromotionById(int $id)

Find promotion by id

Parameters

int $id

Return Value

array

at line 111
bool removePromotionsFromArray(array $arrayOfPromotions)

Remove promotions provided by array of ids

Parameters

array $arrayOfPromotions

Return Value

bool

at line 119
editCoupon($content)

{@inheritdoc}

Parameters

$content

at line 208
Coupon useCoupon(Coupon $coupon)

Increment coupon usage and set used to TRUE if number of uses reached usage limit

Parameters

Coupon $coupon

Return Value

Coupon

at line 221
Coupon|null getCouponById(int $id)

Find coupon by id

Parameters

int $id

Return Value

Coupon|null

at line 230
array getAllCouponsForUser()

Find all coupons for user by id

Return Value

array

at line 244
int|array getActiveCouponsCountForUser()

Count all active coupons for logged user

Return Value

int|array

at line 258
array getAllCouponsForFrontendProfileView()

Find all coupon data for user

Return Value

array

at line 283
array findAllCouponsForFrontend(int $page, int $offset, bool $active, int $userId = null)

Find all promotions for specific user with pagination

Parameters

int $page
int $offset
bool $active
int $userId

Return Value

array

at line 306
array countAllCouponsForFrontend(bool $active, int $userId = null)

Count all promotions for specific user

Parameters

bool $active
int $userId

Return Value

array

at line 327
array getUsers(string $param, int $page, int $offset, array|null $arrayOfUsers = null)

Find all users email

Parameters

string $param
int $page
int $offset
array|null $arrayOfUsers

Return Value

array

at line 339
array|mixed|null|object getCouponDiscountForOrder(string $couponCode)

Parameters

string $couponCode

Return Value

array|mixed|null|object

Exceptions

NonUniqueResultException