APP_Listing_Current_Plan_Decorator
A Current Plan object decorator class.
Package
Description Description
This decorator makes plan object behave as already purchased and activated. It uses reference to listing item for getting some plan options instead of using own meta data.
Current plan cannot be applied to order or activated as regular plan, since supposed, that plan already activated. But it allows to upgrade plan by purchasing additional items (i.e. Addons)
Also Current Plan object could be used to get plan properties directly applied to listing item. (For example, plan duration will be retrieved from listing item meta instead of using specified plan option).
Methods Methods
- __construct — Constructs decorator object.
- deactivate — Deactivates plan.
- get_duration — Retrieves plan duration in days.
- get_expire_date — Retrieves the plan expire date for current listing item.
- get_item_id — Retrieves the listing item id to which current plan has been applied.
- get_period — Retrieves plan duration in other time units, like months or years.
- get_period_text — Generates period text.
- get_period_type — Retrieves period type (D, W, M, Y).
- is_upgradable — Whether current plan could be upgraded.