You are here

function google_api_client_update_8803 in Google API PHP Client 8.4

Same name and namespace in other branches
  1. 8.3 google_api_client.install \google_api_client_update_8803()

Create UUID field for Google Api Client.

File

./google_api_client.install, line 89
Install and uninstall functions for the Google api client module.

Code

function google_api_client_update_8803() {
  \Drupal::entityTypeManager()
    ->clearCachedDefinitions();
  $definition_manager = \Drupal::entityDefinitionUpdateManager();

  // Create a new field definition.
  $new_uuid_field = \Drupal\Core\Field\BaseFieldDefinition::create('uuid')
    ->setLabel(t('UUID'))
    ->setDescription(t('The Google Api Client UUID.'))
    ->setReadOnly(TRUE);

  // Install the new definition.
  $definition_manager
    ->installFieldStorageDefinition('uuid', 'google_api_client', 'google_api_client', $new_uuid_field);
}