You are here

geolocation_geometry_open_canada_provinces.install in Geolocation Field 8.3

Geolocation Geometry country import.

File

modules/geolocation_geometry/modules/geolocation_geometry_open_canada_provinces/geolocation_geometry_open_canada_provinces.install
View source
<?php

/**
 * @file
 * Geolocation Geometry country import.
 */

/**
 * Implements hook_install().
 */
function geolocation_geometry_open_canada_provinces_install() {

  /** @var \Drupal\geolocation_geometry_data\GeolocationGeometryDataManager $geometry_data_manager */
  $geometry_data_manager = \Drupal::service('plugin.manager.geolocation.geometrydata');
  return $geometry_data_manager
    ->executeGemeotryDataBatch($geometry_data_manager
    ->getGemeotryDataBatch('open_canada_provinces'));
}

/**
 * Implements hook_uninstall().
 */
function geolocation_geometry_open_canada_provinces_uninstall() {
  $taxonomy_storage = \Drupal::entityTypeManager()
    ->getStorage('taxonomy_term');
  $taxonomy_storage
    ->delete($taxonomy_storage
    ->loadByProperties([
    'vid' => 'geolocation_provinces_of_canada',
  ]));
}