abstract class ProraterBase in Commerce Recurring Framework 8
Defines the prorater class.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\commerce_recurring\Plugin\Commerce\Prorater\ProraterBase implements ProraterInterface
Expanded class hierarchy of ProraterBase
File
- src/
Plugin/ Commerce/ Prorater/ ProraterBase.php, line 14
Namespace
Drupal\commerce_recurring\Plugin\Commerce\ProraterView source
abstract class ProraterBase extends PluginBase implements ProraterInterface {
/**
* Constructs a new ProraterBase object.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The pluginId for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this
->setConfiguration($configuration);
}
/**
* {@inheritdoc}
*/
public function defaultConfiguration() {
return [];
}
/**
* {@inheritdoc}
*/
public abstract function prorateOrderItem(OrderItemInterface $order_item, BillingPeriod $partial_period, BillingPeriod $period);
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
return [];
}
/**
* {@inheritdoc}
*/
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
}
/**
* {@inheritdoc}
*/
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
}
/**
* {@inheritdoc}
*/
public function getConfiguration() {
return $this->configuration;
}
/**
* {@inheritdoc}
*/
public function setConfiguration(array $configuration) {
$this->configuration = NestedArray::mergeDeep($this
->defaultConfiguration(), $configuration);
}
/**
* {@inheritdoc}
*/
public function calculateDependencies() {
return [];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
ProraterBase:: |
public | function |
Form constructor. Overrides PluginFormInterface:: |
|
ProraterBase:: |
public | function |
Calculates dependencies for the configured plugin. Overrides DependentPluginInterface:: |
|
ProraterBase:: |
public | function |
Gets default configuration for this plugin. Overrides ConfigurableInterface:: |
|
ProraterBase:: |
public | function |
Gets this plugin's configuration. Overrides ConfigurableInterface:: |
|
ProraterBase:: |
abstract public | function |
Prorates the given order item. Overrides ProraterInterface:: |
2 |
ProraterBase:: |
public | function |
Sets the configuration for this plugin instance. Overrides ConfigurableInterface:: |
|
ProraterBase:: |
public | function |
Form submission handler. Overrides PluginFormInterface:: |
|
ProraterBase:: |
public | function |
Form validation handler. Overrides PluginFormInterface:: |
|
ProraterBase:: |
public | function |
Constructs a new ProraterBase object. Overrides PluginBase:: |
1 |