You are here

function business_rules_update_8102 in Business Rules 8

Same name and namespace in other branches
  1. 2.x business_rules.install \business_rules_update_8102()

Allows schedule to work with event variables.

See also

https://www.drupal.org/project/business_rules/issues/3040833

File

./business_rules.install, line 33

Code

function business_rules_update_8102() {
  $fields['update_entity'] = BaseFieldDefinition::create('boolean')
    ->setLabel('Save entity as the last action of the task')
    ->setDescription('It the task will save the entity in the end of the process.');
  $fields['event'] = BaseFieldDefinition::create('map')
    ->setLabel(t('Event.'))
    ->setDescription(t('The event that has created the schedule.'));
  \Drupal::entityDefinitionUpdateManager()
    ->installFieldStorageDefinition('update_entity', 'business_rules_schedule', 'business_rules', $fields['update_entity']);
  \Drupal::entityDefinitionUpdateManager()
    ->installFieldStorageDefinition('event', 'business_rules_schedule', 'business_rules', $fields['event']);
}