MatchEngineBase.php in CRM Core 8
File
modules/crm_core_match/src/Plugin/crm_core_match/engine/MatchEngineBase.php
View source
<?php
namespace Drupal\crm_core_match\Plugin\crm_core_match\engine;
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Plugin\PluginBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
abstract class MatchEngineBase extends PluginBase implements MatchEngineInterface, ContainerFactoryPluginInterface {
protected $configuration;
protected $pluginId;
protected $pluginDefinition;
public function __construct($configuration, $plugin_id, $plugin_definition) {
$this->configuration = $configuration;
$this->pluginDefinition = $plugin_definition;
$this->pluginId = $plugin_id;
}
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition);
}
public function getConfiguration() {
return $this->configuration;
}
public function setConfiguration(array $configuration) {
$this->configuration = $configuration;
}
public function getConfigurationItem($key) {
$configuration = $this
->getConfiguration();
return NestedArray::getValue($configuration, (array) $key);
}
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 getRules() {
return [];
}
}