You are here

function styled_google_map_data_uninstall in Styled Google Map 8.2

File

modules/data/styled_google_map_data.install, line 53

Code

function styled_google_map_data_uninstall() {

  // Delete demo data.
  $term_storage = \Drupal::entityTypeManager()
    ->getStorage('taxonomy_term');
  $terms = $term_storage
    ->loadByProperties([
    'vid' => 'real_estate',
  ]);
  $term_storage
    ->delete($terms);

  // Update all term depths.
  batch_set([
    'operations' => [
      [
        'delete_real_estate',
        [],
      ],
    ],
    'finished' => 'demo_real_estate_finished',
    'title' => t('Delete real estate'),
    'file' => drupal_get_path('module', 'styled_google_map_data') . '/demo.batch.inc',
  ]);

  // Processes the batch in cli mode.
  if (function_exists('drush_backend_batch_process')) {
    $batch =& batch_get();
    $batch['progressive'] = FALSE;
    drush_backend_batch_process();
  }
}