APP_Listing_Plan_Decorator
A Plan object decorator.
Package
Description Description
Allows to plugins or modules extend standard plan object methods by using APP_Listing_Plan_Decorator classes. The decorator wraps given plan object by itself and can be wrapped by other decorator. Both plan object and decorators are using the same interface APP_Listing_Plan_I, therefore all original plan methods will be inherited by the decorator.
Use to apply to a plan object custom properties and behaviour dynamically.
Methods Methods
- __call — Magic method: $plan->$method()
- __construct — Constructs decorator object.
- __get — Magic method: $plan->arg
- __set — Magic setter
- activate — Activates plan.
- apply — Applies plan attributes to an order item.
- get_description — Retrieves a plan description.
- get_duration — Retrieves plan duration in days.
- get_duration_key — Retrieves plan duration meta key.
- 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).
- get_price — Retrieves plan price.
- get_ref_object — Retrieves the referenced object.
- get_title — Retrieves a plan title.
- get_type — Retrieves a plan type.
- has_options — Determines whether plan has optional items to be selected by user.
- render — Renders optional plan fields
- setup — Adds Plan specific data to a given checkout object.