BillingScheduleBase.php in Commerce Recurring Framework 8
File
src/Plugin/Commerce/BillingSchedule/BillingScheduleBase.php
View source
<?php
namespace Drupal\commerce_recurring\Plugin\Commerce\BillingSchedule;
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\PluginBase;
abstract class BillingScheduleBase extends PluginBase implements BillingScheduleInterface {
protected $entityId;
public function __construct(array $configuration, $plugin_id, $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
if (array_key_exists('_entity_id', $configuration)) {
$this->entityId = $configuration['_entity_id'];
unset($configuration['_entity_id']);
}
$this
->setConfiguration($configuration);
}
public function calculateDependencies() {
return [];
}
public function getConfiguration() {
return $this->configuration;
}
public function setConfiguration(array $configuration) {
$this->configuration = NestedArray::mergeDeep($this
->defaultConfiguration(), $configuration);
}
public function defaultConfiguration() {
return [];
}
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
return $form;
}
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
}
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
}
public function getLabel() {
return (string) $this->pluginDefinition['label'];
}
}