SubscriptionBillingFrequency.php
3 years ago
SubscriptionEntity.php
1 year ago
SubscriptionFactory.php
3 years ago
SubscriptionStatus.php
3 years ago
SubscriptionTrialPeriod.php
3 years ago
index.php
3 years ago
SubscriptionStatus.php
30 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ProfilePress\Core\Membership\Models\Subscription; |
| 4 | |
| 5 | class SubscriptionStatus |
| 6 | { |
| 7 | const ACTIVE = 'active'; |
| 8 | const PENDING = 'pending'; |
| 9 | const CANCELLED = 'cancelled'; |
| 10 | const EXPIRED = 'expired'; |
| 11 | const TRIALLING = 'trialling'; |
| 12 | const COMPLETED = 'completed'; |
| 13 | |
| 14 | public static function get_all() |
| 15 | { |
| 16 | return apply_filters('ppress_subscription_statuses', [ |
| 17 | self::ACTIVE => __('Active', 'wp-user-avatar'), |
| 18 | self::PENDING => __('Pending', 'wp-user-avatar'), |
| 19 | self::EXPIRED => __('Expired', 'wp-user-avatar'), |
| 20 | self::COMPLETED => __('Completed', 'wp-user-avatar'), |
| 21 | self::TRIALLING => __('Trialling', 'wp-user-avatar'), |
| 22 | self::CANCELLED => __('Cancelled', 'wp-user-avatar') |
| 23 | ]); |
| 24 | } |
| 25 | |
| 26 | public static function get_label($status) |
| 27 | { |
| 28 | return self::get_all()[$status] ?? ''; |
| 29 | } |
| 30 | } |