function _update_8000_entity_get_form_display

Returns the raw configuration object for an EntityFormDisplay entity.

The function returns the existing configuration entry if it exists, or creates a fresh structure.

Parameters

string $entity_type: The entity type.

string $bundle: The bundle name.

string $form_mode: The form mode.

Return value

\Drupal\Core\Config\Config The configuration object.

3 calls to _update_8000_entity_get_form_display()
block_update_8008 in drupal/core/modules/block/block.install
Migrate {block_custom}.body and {block_custom}.format to block_body field.
field_update_8002 in drupal/core/modules/field/field.install
Migrate all instance widget and display settings to configuration.
user_update_8011 in drupal/core/modules/user/user.install
Create user picture field.

File

drupal/core/modules/entity/entity.install, line 65
Install, update and uninstall functions for the entity module.

Code

function _update_8000_entity_get_form_display($entity_type, $bundle, $form_mode) {
  $id = $entity_type . '.' . $bundle . '.' . $form_mode;
  $config = config("entity.form_display.{$id}");
  if ($config
    ->get()) {
    return $config;
  }

  // Initialize a fresh structure.
  $uuid = new Uuid();
  $properties = array(
    'id' => $id,
    'uuid' => $uuid
      ->generate(),
    'targetEntityType' => $entity_type,
    'bundle' => $bundle,
    'mode' => $form_mode,
    'content' => array(),
  );
  foreach ($properties as $key => $value) {
    $config
      ->set($key, $value);
  }
  return $config;
}