You are here

function opigno_moxtra_update_8009 in Opigno Moxtra 8

Creates the notified members field in the meetings.

File

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

Code

function opigno_moxtra_update_8009() {

  // Create a new field definition.
  $field = BaseFieldDefinition::create('entity_reference')
    ->setLabel(t('Notified Members'))
    ->setDescription(t('Members of the Meeting entity that received notification by email.'))
    ->setSettings([
    'target_type' => 'user',
    'handler' => 'default',
  ])
    ->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);

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