Promotion
class Promotion implements PromotionInterface
Class Promotion
Properties
| protected int | $id | ||
| protected string|null | $name | Promotion name | |
| protected string|null | $description | Promotion description | |
| protected integer|null | $priority | When exclusive, promotion with top priority will be applied | |
| protected bool|null | $exclusive | Cannot be applied together with other promotions | |
| protected string | $type | Promotion type | |
| protected string|null | $code | Promotion code | |
| protected int|null | $usageLimit | Maximum number of time promotion can be used | |
| protected bool|null | $used | Number of times promotion has been used | |
| protected DateTime|null | $startsAt | Date from which promotion is valid | |
| protected DateTime|null | $endsAt | Date until which promotion is valid | |
| protected bool|null | $couponBased | Whether this promotion is triggered by a coupon | |
| protected bool|null | $sendByMail | Notify users about promotion | |
| protected DateTime|null | $updatedAt | Date when promotion last updated | |
| protected DateTime|null | $createdAt | Date when promotion created | |
| protected bool|null | $allUsersSelected | Promotion valid for all users | |
| protected Collection|CouponInterface[] | $coupons | List of associated coupons | |
| protected Collection|RuleInterface[] | $rules | List of associated rules | |
| protected Collection|ActionInterface[] | $actions | List of associated actions | |
| protected ArrayCollection|Order[] | $orders | List of orders on which promotion applied |
Methods
Promotion constructor.
No description
Get name
Set name
Get description
Set description
Get priority
Set priority
Is exclusive
Set exclusive
Get usage limit
Set usage limit
Get usage
Set usage
Increment usage
Get start date
No description
No description
No description
{@inheritdoc}
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
{@inheritdoc}
(PHP 5 >= 5.1.0)
String representation of object
(PHP 5 >= 5.1.0)
Constructs the object
When an object is cloned, PHP 5 will perform a shallow copy of all of the object's properties.
Details
at line 256
__construct()
Promotion constructor.
at line 268
int
getId()
at line 276
string|null
getName()
Get name
at line 284
PromotionInterface
setName(string|null $name)
Set name
at line 294
string|null
getDescription()
Get description
at line 302
PromotionInterface
setDescription(string|null $description)
Set description
at line 312
int|null
getPriority()
Get priority
at line 320
PromotionInterface
setPriority(int|null $priority)
Set priority
at line 330
bool|null
isExclusive()
Is exclusive
at line 338
PromotionInterface
setExclusive(bool|null $exclusive)
Set exclusive
at line 348
int|null
getUsageLimit()
Get usage limit
at line 356
PromotionInterface
setUsageLimit(int|null $usageLimit)
Set usage limit
at line 366
int|null
getUsed()
Get usage
at line 374
PromotionInterface
setUsed(int|null $used)
Set usage
at line 384
incrementUsed()
Increment usage
at line 394
DateTime|null
getStartsAt()
Get start date
at line 402
PromotionInterface
setStartsAt(DateTime $startsAt = null)
Set start date
at line 412
DateTime|null
getEndsAt()
Get end date
at line 420
PromotionInterface
setEndsAt(DateTime $endsAt = null)
Set end date
at line 430
bool|null
isCouponBased()
at line 438
PromotionInterface
setCouponBased(bool|null $couponBased)
at line 448
Collection|CouponInterface[]
getCoupons()
at line 456
setCoupons($coupons)
{@inheritdoc}
at line 466
bool
hasCoupons()
at line 474
Boolean
hasCoupon(CouponInterface $coupon)
at line 482
PromotionInterface
addCoupon(CouponInterface $coupon)
at line 496
PromotionInterface
removeCoupon(CouponInterface $coupon)
at line 507
bool
hasRules()
at line 515
Collection|RuleInterface[]
getRules()
at line 523
bool
hasRule(RuleInterface $rule)
at line 531
PromotionInterface
addRule(RuleInterface $rule)
at line 544
PromotionInterface
removeRule(RuleInterface $rule)
at line 555
bool
hasActions()
at line 563
Collection|ActionInterface[]
getActions()
at line 571
bool
hasAction(ActionInterface $action)
at line 579
PromotionInterface
addAction(ActionInterface $action)
at line 592
PromotionInterface
removeAction(ActionInterface $action)
at line 603
mixed
getUpdatedAt()
at line 611
mixed
setUpdatedAt(DateTime $updatedAt)
at line 621
mixed
getCreatedAt()
at line 629
mixed
setCreatedAt(DateTime $createdAt)
at line 639
PromotionInterface
addOrder(Order $order)
at line 647
PromotionInterface
removeOrder(Order $order)
at line 655
Promotion
removeAllCoupons()
at line 668
ArrayCollection
getOrders()
at line 676
bool|null
isAllUsersSelected()
at line 686
Promotion
setAllUsersSelected(bool|null $allUsersSelected)
at line 696
string
getType()
at line 704
bool
isCoupon()
at line 714
Promotion
setType(string $type)
at line 724
string
getCode()
at line 734
Promotion
setCode(string $code)
at line 744
bool
isSendByMail()
at line 754
Promotion
setSendByMail(bool $sendByMail)
at line 764
isValid()
{@inheritdoc}
at line 779
string
serialize()
(PHP 5 >= 5.1.0)
String representation of object
at line 799
void
unserialize(string $serialized)
(PHP 5 >= 5.1.0)
Constructs the object
at line 818
mixed
__clone()
When an object is cloned, PHP 5 will perform a shallow copy of all of the object's properties.
Any properties that are references to other variables, will remain references. Once the cloning is complete, if a __clone() method is defined, then the newly created object's __clone() method will be called, to allow any necessary properties that need to be changed. NOT CALLABLE DIRECTLY.