You are here

function simple_styleguide_update_8001 in Simple Style Guide 8

Adding weight field to styleguide patterns.

File

./simple_styleguide.install, line 13
Contains simple_styleguide.install.

Code

function simple_styleguide_update_8001() {
  $field_storage_definition = BaseFieldDefinition::create('integer')
    ->setLabel(t('Weight'))
    ->setDescription(t('Row weight of entity.'))
    ->setDefaultValue(0)
    ->setRevisionable(FALSE);
  \Drupal::entityDefinitionUpdateManager()
    ->installFieldStorageDefinition('start', 'styleguide_pattern', 'styleguide_pattern', $field_storage_definition);
}