You are here

function entity_legal_uninstall in Entity Legal 7

Same name and namespace in other branches
  1. 7.2 entity_legal.install \entity_legal_uninstall()

Implements hook_uninstall().

File

./entity_legal.install, line 11
Install, update and uninstall functions for the entity_legal module.

Code

function entity_legal_uninstall() {
  $instances = field_read_instances(array(
    'entity_type' => 'entity_legal_document_version',
  ), array(
    'include_inactive' => TRUE,
    'include_deleted' => TRUE,
  ));
  foreach ($instances as $instance) {
    field_delete_instance($instance);
  }

  // Delete document text field.
  $field = field_info_field('entity_legal_document_text');
  if ($field) {
    field_purge_field($field);
  }
}