You are here

protected function HostingFieldCleanup::deleteFieldData in Aegir Objects 7.3

Delete data for all fields defined in this module.

1 call to HostingFieldCleanup::deleteFieldData()
HostingFieldCleanup::uninstallModule in classes/HostingFieldCleanup.inc
Call this method when uninstalling a module.

File

classes/HostingFieldCleanup.inc, line 46
The HostingFieldCleanup class.

Class

HostingFieldCleanup
@file The HostingFieldCleanup class.

Code

protected function deleteFieldData() {
  if (module_load_include('inc', $this->module, $this->module . '.features.field_base')) {
    $function = $this->module . '_field_default_field_bases';
    if (function_exists($function)) {
      $fields = array_keys($function());
      foreach ($fields as $field) {
        field_delete_field($field);
      }
    }
  }
}