function announcements_feed_post_update_migrate_last_fetch_state_to_keyvalue

Same name and namespace in other branches
  1. main core/modules/announcements_feed/announcements_feed.post_update.php \announcements_feed_post_update_migrate_last_fetch_state_to_keyvalue()

Migrates last fetch timestamp from State API to key/value storage.

File

core/modules/announcements_feed/announcements_feed.post_update.php, line 11

Code

function announcements_feed_post_update_migrate_last_fetch_state_to_keyvalue() : void {
  $state = \Drupal::state();
  $last_fetch = (int) $state->get('announcements_feed.last_fetch', 0);
  \Drupal::keyValue('announcements_feed')->set('last_fetch', $last_fetch);
  $state->delete('announcements_feed.last_fetch');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.