You are here

DateRecurInterpreterPluginBase.php in Recurring Dates Field 3.x

File

src/Plugin/DateRecurInterpreterPluginBase.php
View source
<?php

declare (strict_types=1);
namespace Drupal\date_recur\Plugin;

use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Plugin\PluginBase;
use Drupal\Core\Plugin\PluginWithFormsTrait;

/**
 * Base class for date recur interpreter plugins.
 */
abstract class DateRecurInterpreterPluginBase extends PluginBase implements DateRecurInterpreterPluginInterface {
  use PluginWithFormsTrait;

  /**
   * {@inheritdoc}
   */
  public function calculateDependencies() : array {
    return [];
  }

  /**
   * {@inheritdoc}
   */
  public function getConfiguration() : array {
    return $this->configuration;
  }

  /**
   * {@inheritdoc}
   */
  public function setConfiguration(array $configuration) : void {
    $this->configuration = NestedArray::mergeDeep($this
      ->defaultConfiguration(), $configuration);
  }

  /**
   * {@inheritdoc}
   */
  public function defaultConfiguration() : array {
    return [];
  }

}

Classes

Namesort descending Description
DateRecurInterpreterPluginBase Base class for date recur interpreter plugins.