You are here

public function DummyFieldProperty::buildConfigurationForm in Search API Solr 8.2

Same name and namespace in other branches
  1. 8.3 src/Plugin/search_api/processor/Property/DummyFieldProperty.php \Drupal\search_api_solr\Plugin\search_api\processor\Property\DummyFieldProperty::buildConfigurationForm()
  2. 4.x src/Plugin/search_api/processor/Property/DummyFieldProperty.php \Drupal\search_api_solr\Plugin\search_api\processor\Property\DummyFieldProperty::buildConfigurationForm()

Constructs a configuration form for a field based on this property.

Parameters

\Drupal\search_api\Item\FieldInterface $field: The field for which the configuration form is constructed.

array $form: An associative array containing the initial structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the complete form.

Return value

array The form structure.

Overrides ConfigurablePropertyInterface::buildConfigurationForm

File

src/Plugin/search_api/processor/Property/DummyFieldProperty.php, line 31

Class

DummyFieldProperty
Defines a "dummy field" property.

Namespace

Drupal\search_api_solr\Plugin\search_api\processor\Property

Code

public function buildConfigurationForm(FieldInterface $field, array $form, FormStateInterface $form_state) {
  $configuration = $field
    ->getConfiguration();
  $form['dummy_value'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Dummy value'),
    '#description' => $this
      ->t('The value to be set initially on the dummy field.'),
    '#default_value' => $configuration['dummy_value'],
    '#required' => TRUE,
  ];
  return $form;
}