You are here

function opigno_module_update_8018 in Opigno module 8

Add skill levels for answers.

File

./opigno_module.install, line 1176
Opigno module app install/update functionality.

Code

function opigno_module_update_8018() {
  $definition_manager = \Drupal::entityDefinitionUpdateManager();
  $field = BaseFieldDefinition::create('integer')
    ->setLabel(t('Skill level'))
    ->setDescription(t('Show if skill mode is activated.'))
    ->setDefaultValue(0);
  $definition_manager
    ->installFieldStorageDefinition('skill_level', 'opigno_answer', 'opigno_module', $field);
}