Example #1
0
 /**
  * {@inheritdoc}
  */
 public function validateForm(array &$form, FormStateInterface $form_state)
 {
     parent::validateForm($form, $form_state);
     /** @var \Drupal\crm_core_match\Matcher\MatcherConfigInterface $matcher */
     $matcher = $this->entity;
     /** @var \Drupal\crm_core_match\Plugin\crm_core_match\engine\MatchEngineInterface $plugin */
     if ($matcher->isNew()) {
         $plugin_id = $form_state->getValue('plugin_id');
         $plugin = crm_core_match_matcher_manager()->createInstance($plugin_id, $matcher->getConfiguration());
     } else {
         $plugin = $matcher->getPlugin();
     }
     $plugin->validateConfigurationForm($form, $form_state);
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function getPlugin()
 {
     if (empty($this->plugin)) {
         $this->plugin = crm_core_match_matcher_manager()->createInstance($this->plugin_id, $this->configuration);
     }
     return $this->plugin;
 }