function workspaces_update_11303

Add the workspace provider field.

File

core/modules/workspaces/workspaces.install, line 315

Code

function workspaces_update_11303() : void {
  $entity_definition_update = \Drupal::entityDefinitionUpdateManager();
  $storage_definition = BaseFieldDefinition::create('string')->setLabel(new TranslatableMarkup('Provider'))
    ->setSetting('max_length', 128)
    ->setRequired(TRUE)
    ->setReadOnly(TRUE)
    ->setDefaultValue(DefaultWorkspaceProvider::getId())
    ->setInitialValue(DefaultWorkspaceProvider::getId());
  $entity_definition_update->installFieldStorageDefinition('provider', 'workspace', 'workspaces', $storage_definition);
}

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