| 1 | <?php |
||
| 10 | class Subscription |
||
| 11 | { |
||
| 12 | use SubscriptionTrait; |
||
| 13 | |||
| 14 | const SUBSCRIPTION_STATUS_ACTIVE = 'active'; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Inactive subscription, usually after a payment failed. |
||
| 18 | */ |
||
| 19 | const SUBSCRIPTION_STATUS_INACTIVE = 'inactive'; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * While in the trial period. |
||
| 23 | */ |
||
| 24 | const SUBSCRIPTION_STATUS_TRIAL = 'trial'; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * If it has reached the cancellation date. |
||
| 28 | */ |
||
| 29 | const SUBSCRIPTION_STATUS_CANCELED = 'canceled'; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * If the subscription is closed. |
||
| 33 | */ |
||
| 34 | const SUBSCRIPTION_STATUS_CLOSED = 'closed'; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * The coupon applied to the subscription. |
||
| 38 | * |
||
| 39 | 18 | * @var Coupon |
|
| 40 | * |
||
| 41 | * @JMS\Type("Speicher210\Fastbill\Api\Model\Coupon") |
||
| 42 | 18 | * @JMS\SerializedName("COUPON") |
|
| 43 | */ |
||
| 44 | 18 | protected $coupon; |
|
| 45 | |||
| 46 | 18 | /** |
|
| 47 | * Get the coupon for the subscription. |
||
| 48 | * |
||
| 49 | * @return Coupon |
||
| 50 | */ |
||
| 51 | public function getCoupon() |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Set the coupon. |
||
| 58 | * |
||
| 59 | * @param Coupon $coupon The coupon to set. |
||
| 60 | */ |
||
| 61 | public function setCoupon(Coupon $coupon) |
||
| 65 | |||
| 66 | /** |
||
| 67 | * Check if the current subscription is running. |
||
| 68 | * |
||
| 69 | * @return boolean |
||
| 70 | */ |
||
| 71 | public function isRunning() |
||
| 80 | } |
||
| 81 |