You are here

function yamlform_node_uninstall in YAML Form 8

Implements hook_uninstall().

File

modules/yamlform_node/yamlform_node.install, line 14
Install, update and uninstall functions for the form node module.

Code

function yamlform_node_uninstall() {

  // Delete the form node type.
  if ($node_type = NodeType::load('yamlform')) {
    $node_type
      ->delete();
  }

  // Delete field storage if it is no longer being used by any bundles.
  if ($field_storage = \Drupal::entityTypeManager()
    ->getStorage('field_storage_config')
    ->load('node.yamlform')) {
    if (!$field_storage
      ->getBundles()) {
      $field_storage
        ->delete();
    }
  }
}