function FieldStorageConfigEditForm::getEntityFromRouteMatch

Same name in other branches
  1. 9 core/modules/field_ui/src/Form/FieldStorageConfigEditForm.php \Drupal\field_ui\Form\FieldStorageConfigEditForm::getEntityFromRouteMatch()
  2. 8.9.x core/modules/field_ui/src/Form/FieldStorageConfigEditForm.php \Drupal\field_ui\Form\FieldStorageConfigEditForm::getEntityFromRouteMatch()
  3. 10 core/modules/field_ui/src/Form/FieldStorageConfigEditForm.php \Drupal\field_ui\Form\FieldStorageConfigEditForm::getEntityFromRouteMatch()

Overrides EntityForm::getEntityFromRouteMatch

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 getEntityFromRouteMatch(RouteMatchInterface $route_match, $entity_type_id) {
    // The URL of this entity form contains only the ID of the field_config
    // but we are actually editing a field_storage_config entity.
    $field_config = FieldConfig::load($route_match->getRawParameter('field_config'));
    if (!$field_config) {
        throw new NotFoundHttpException();
    }
    return $field_config->getFieldStorageDefinition();
}

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