You are here

function bibcite_entity_update_8011 in Bibliography & Citation 8

Same name and namespace in other branches
  1. 2.0.x modules/bibcite_entity/bibcite_entity.install \bibcite_entity_update_8011()

Update contributor entity.

File

modules/bibcite_entity/bibcite_entity.install, line 412
Module installation hooks implementation.

Code

function bibcite_entity_update_8011() {
  $definition_update_manager = \Drupal::entityDefinitionUpdateManager();
  $leading_definition = BaseFieldDefinition::create('string')
    ->setLabel(t('Leading initial'))
    ->setDefaultValue('');
  $middle_definition = BaseFieldDefinition::create('string')
    ->setLabel(t('Middle name'))
    ->setDefaultValue('');
  $nickname_definition = BaseFieldDefinition::create('string')
    ->setLabel(t('Nickname'))
    ->setDefaultValue('');
  $definition_update_manager
    ->installFieldStorageDefinition('leading_title', 'bibcite_contributor', 'bibcite_entity', $leading_definition);
  $definition_update_manager
    ->installFieldStorageDefinition('middle_name', 'bibcite_contributor', 'bibcite_entity', $middle_definition);
  $definition_update_manager
    ->installFieldStorageDefinition('nick', 'bibcite_contributor', 'bibcite_entity', $nickname_definition);
}