PromotionRepository
class PromotionRepository extends EntityRepository
Class PromotionRepository is injected as alligator.promotion_repository service. PromotionRepository is used for crud operation for managed entity.
Use this class to work with database.
Constants
| ALIAS |
Alias for promotion |
| COUPON_ALIAS |
Alias for coupon |
| USER_ALIAS |
Alias for user |
| RULE_ALIAS |
Alias for rule |
| ACTION_ALIAS |
Alias for action |
Methods
start db transaction
commit db transaction
rollback db transaction
Find promotion by id
Find all promotions with pagination
Find promotions by search term or count them
Remove promotions provided by array of ids
Find promotion for all users by code
Find all promotions for specific user with pagination
Count all promotions for specific user
Details
at line 69
startTransaction()
start db transaction
at line 77
commitTransaction()
commit db transaction
at line 85
rollbackTransaction()
rollback db transaction
at line 96
array
getOneById(int $id)
Find promotion by id
at line 162
mixed
findAllForJQGRID(mixed $page, mixed $offset, mixed $sortParams)
Find all promotions with pagination
at line 186
array
searchForJQGRID(array $searchParams, array $sortParams, bool $isCountSearch = false)
Find promotions by search term or count them
at line 341
bool
removePromotionsFromArray(array $arrayOfPromotions)
Remove promotions provided by array of ids
at line 370
Promotion|null
findPromotionForAllByCode(string $code, bool $onlyAdjustments)
Find promotion for all users by code
at line 392
array
findAllPromotionsForFrontend(int $page, int $offset, bool $active, int $userId)
Find all promotions for specific user with pagination
at line 428
array
countAllPromotionsForFrontend(bool $active, int $userId)
Count all promotions for specific user