You are here

function opigno_moxtra_update_8006 in Opigno Moxtra 8

Creates the calendar event field in the meetings.

File

./opigno_moxtra.install, line 186
Install, update and uninstall functions for the Opigno Moxtra module.

Code

function opigno_moxtra_update_8006() {

  // Create a new field definition.
  $field = BaseFieldDefinition::create('entity_reference')
    ->setLabel(t('Related calendar event'))
    ->setDescription(t('The related calendar event of the Meeting entity.'))
    ->setSettings([
    'target_type' => 'opigno_calendar_event',
    'handler' => 'default',
  ]);

  // Install the new definition.
  $definition_manager = \Drupal::entityDefinitionUpdateManager();
  $definition_manager
    ->installFieldStorageDefinition('calendar_event', 'opigno_moxtra_meeting', 'opigno_moxtra_meeting', $field);
}