You are here

abstract class MatchEngineBase in CRM Core 8.3

Same name and namespace in other branches
  1. 8 modules/crm_core_match/src/Plugin/crm_core_match/engine/MatchEngineBase.php \Drupal\crm_core_match\Plugin\crm_core_match\engine\MatchEngineBase
  2. 8.2 modules/crm_core_match/src/Plugin/crm_core_match/engine/MatchEngineBase.php \Drupal\crm_core_match\Plugin\crm_core_match\engine\MatchEngineBase

Default implementation of MatchEngineInterface.

Safe for use by most matching engines.

Hierarchy

Expanded class hierarchy of MatchEngineBase

File

modules/crm_core_match/src/Plugin/crm_core_match/engine/MatchEngineBase.php, line 16

Namespace

Drupal\crm_core_match\Plugin\crm_core_match\engine
View source
abstract class MatchEngineBase extends PluginBase implements MatchEngineInterface, ContainerFactoryPluginInterface {

  /**
   * The engine configuration.
   *
   * @var array
   */
  protected $configuration;

  /**
   * The plugin id.
   *
   * @var string
   */
  protected $pluginId;

  /**
   * The plugin implementation definition.
   *
   * @var array
   */
  protected $pluginDefinition;

  /**
   * Constructs an plugin instance.
   */
  public function __construct($configuration, $plugin_id, $plugin_definition) {
    $this->configuration = $configuration;
    $this->pluginDefinition = $plugin_definition;
    $this->pluginId = $plugin_id;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static($configuration, $plugin_id, $plugin_definition);
  }

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

  /**
   * {@inheritdoc}
   */
  public function setConfiguration(array $configuration) {
    $this->configuration = $configuration;
  }

  /**
   * {@inheritdoc}
   */
  public function getConfigurationItem($key) {
    $configuration = $this
      ->getConfiguration();
    return NestedArray::getValue($configuration, (array) $key);
  }

  /**
   * {@inheritdoc}
   */
  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
    return $form;
  }

  /**
   * {@inheritdoc}
   */
  public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {

    // Do nothing.
  }

  /**
   * {@inheritdoc}
   */
  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {

    // Do nothing.
  }

  /**
   * {@inheritdoc}
   */
  public function getRules() {
    return [];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigurableInterface::defaultConfiguration public function Gets default configuration for this plugin. 11
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
DependentPluginInterface::calculateDependencies public function Calculates dependencies for the configured plugin. 19
MatchEngineBase::$configuration protected property The engine configuration. Overrides PluginBase::$configuration
MatchEngineBase::$pluginDefinition protected property The plugin implementation definition. Overrides PluginBase::$pluginDefinition
MatchEngineBase::$pluginId protected property The plugin id. Overrides PluginBase::$pluginId
MatchEngineBase::buildConfigurationForm public function Form constructor. Overrides PluginFormInterface::buildConfigurationForm 1
MatchEngineBase::create public static function Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface::create 1
MatchEngineBase::getConfiguration public function Gets this plugin's configuration. Overrides ConfigurableInterface::getConfiguration
MatchEngineBase::getConfigurationItem public function Returns a specific item of this plugin's configuration. Overrides MatchEngineInterface::getConfigurationItem
MatchEngineBase::getRules public function Gets the rules that are matched. Overrides MatchEngineInterface::getRules 1
MatchEngineBase::setConfiguration public function Sets the configuration for this plugin instance. Overrides ConfigurableInterface::setConfiguration
MatchEngineBase::submitConfigurationForm public function Form submission handler. Overrides PluginFormInterface::submitConfigurationForm 1
MatchEngineBase::validateConfigurationForm public function Form validation handler. Overrides PluginFormInterface::validateConfigurationForm 1
MatchEngineBase::__construct public function Constructs an plugin instance. Overrides PluginBase::__construct 1
MatchEngineInterface::match public function Finds matches for given contact. 1
MessengerTrait::$messenger protected property The messenger. 29
MessengerTrait::messenger public function Gets the messenger. 29
MessengerTrait::setMessenger public function Sets the messenger.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.