You are here

public function FieldStorageConfigEditForm::buildForm in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/field_ui/src/Form/FieldStorageConfigEditForm.php \Drupal\field_ui\Form\FieldStorageConfigEditForm::buildForm()
  2. 9 core/modules/field_ui/src/Form/FieldStorageConfigEditForm.php \Drupal\field_ui\Form\FieldStorageConfigEditForm::buildForm()

Parameters

array $form: A nested array form elements comprising the form.

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

string $field_config: The ID of the field config whose field storage config is being edited.

Overrides EntityForm::buildForm

File

core/modules/field_ui/src/Form/FieldStorageConfigEditForm.php, line 51

Class

FieldStorageConfigEditForm
Provides a form for the "field storage" edit page.

Namespace

Drupal\field_ui\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $field_config = NULL) {
  if ($field_config) {
    $field = FieldConfig::load($field_config);
    $form_state
      ->set('field_config', $field);
    $form_state
      ->set('entity_type_id', $field
      ->getTargetEntityTypeId());
    $form_state
      ->set('bundle', $field
      ->getTargetBundle());
  }
  return parent::buildForm($form, $form_state);
}