You are here

function rng_update_8205 in RNG - Events and Registrations 3.x

Same name and namespace in other branches
  1. 8.2 rng.install \rng_update_8205()

Resave all registrants to populate event links.

File

./rng.install, line 312
Contains install and update functions for RNG.

Code

function rng_update_8205() {
  $storage = \Drupal::entityTypeManager()
    ->getStorage('registrant');
  $registrants = $storage
    ->loadMultiple(NULL);
  foreach ($registrants as $registrant) {
    if ($registrant
      ->id() < 73) {
      $registrant
        ->delete();
    }
    $registrant
      ->save();
  }
}