You are here

function event_update_8101 in Event 8

Update event type config to be just 'type'

File

./event.install, line 8

Code

function event_update_8101() {
  $config_factory = \Drupal::configFactory();
  $configs = $config_factory
    ->listAll('event.event_type');
  foreach ($configs as $config) {
    $event_config = $config_factory
      ->getEditable($config);
    $event_config
      ->setName(preg_replace('/event.event_type/', 'event.type', $config));
    $event_config
      ->save();
  }
}