function FieldStorageConfigEditForm::buildForm

Same name and namespace in other branches
  1. 8.9.x core/modules/field_ui/src/Form/FieldStorageConfigEditForm.php \Drupal\field_ui\Form\FieldStorageConfigEditForm::buildForm()
  2. 10 core/modules/field_ui/src/Form/FieldStorageConfigEditForm.php \Drupal\field_ui\Form\FieldStorageConfigEditForm::buildForm()
  3. 11.x 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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.