function yamlform_update_8005 in YAML Form 8
Issue #2712457: Implement Wizard/Paging. Add 'current_page' field to 'yamlform_submission' entities.
File
- includes/
yamlform.update.inc, line 124 - YAML Form module update hooks.
Code
function yamlform_update_8005() {
// Install the definition that this field had in
// \Drupal\yamlform\Entity\YamlFormSubmission::baseFieldDefinitions()
// at the time that this update function was written. If/when code is
// deployed that changes that definition, the corresponding module must
// implement an update function that invokes
// \Drupal::entityDefinitionUpdateManager()->updateFieldStorageDefinition()
// with the new definition.
$storage_definition = BaseFieldDefinition::create('string')
->setLabel(t('Current page'))
->setDescription(t('The current wizard page.'))
->setSetting('max_length', 128);
\Drupal::entityDefinitionUpdateManager()
->installFieldStorageDefinition('current_page', 'yamlform_submission', 'yamlform', $storage_definition);
}