You are here

function _commerce_file_delete_line_item_fields in Commerce File 7

Delete fields created by this module

1 call to _commerce_file_delete_line_item_fields()
commerce_file_uninstall in ./commerce_file.install
Implements hook_uninstall().

File

./commerce_file.module, line 1149
Provides integration of file licenses with Commerce

Code

function _commerce_file_delete_line_item_fields() {
  $field_names = _commerce_file_get_field_names();
  foreach (array(
    'line_item_files',
  ) as $field_key) {
    if (isset($field_names[$field_key])) {
      $params = array(
        'field_name' => $field_names[$field_key],
      );
      foreach (field_read_instances($params, array(
        'include_inactive' => TRUE,
      )) as $instance) {
        commerce_delete_instance($instance);
      }
    }
  }
}