trait PluginFormTrait in Search API 8
Provides default implementations for plugin configuration forms.
Hierarchy
- trait \Drupal\search_api\Plugin\PluginFormTrait
See also
\Drupal\Core\Plugin\PluginFormInterface
11 files declare their use of PluginFormTrait
- AddHierarchy.php in src/
Plugin/ search_api/ processor/ AddHierarchy.php - Basic.php in src/
Plugin/ search_api/ tracker/ Basic.php - ContentEntity.php in src/
Plugin/ search_api/ datasource/ ContentEntity.php - Database.php in modules/
search_api_db/ src/ Plugin/ search_api/ backend/ Database.php - FieldsProcessorPluginBase.php in src/
Processor/ FieldsProcessorPluginBase.php
File
- src/
Plugin/ PluginFormTrait.php, line 14
Namespace
Drupal\search_api\PluginView source
trait PluginFormTrait {
/**
* Form validation handler.
*
* @param array $form
* An associative array containing the structure of the plugin form as built
* by static::buildConfigurationForm().
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the complete form.
*
* @see \Drupal\Core\Plugin\PluginFormInterface::validateConfigurationForm()
*/
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
}
/**
* Form submission handler.
*
* @param array $form
* An associative array containing the structure of the plugin form as built
* by static::buildConfigurationForm().
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the complete form.
*
* @see \Drupal\Core\Plugin\PluginFormInterface::submitConfigurationForm()
*/
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
// @todo Clean this up once we depend on Drupal 9.0+.
if ($this instanceof ConfigurableInterface || $this instanceof DrupalConfigurablePluginInterface) {
$this
->setConfiguration($form_state
->getValues());
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PluginFormTrait:: |
public | function | Form submission handler. | 7 |
PluginFormTrait:: |
public | function | Form validation handler. | 2 |