You are here

function ad_type_delete in Advertisement 7.2

Deletes an ad type.

Parameters

$type: The machine-readable name of the ad type.

1 call to ad_type_delete()
ad_ui_type_delete_form_submit in includes/ad_ui.types.inc

File

./ad.module, line 178
Defines the core ad entity, including the entity itself, the bundle definitions (ad types), and various API functions to manage ads and interact with them through forms and autocompletes.

Code

function ad_type_delete($type) {
  $ad_type = ad_type_load($type);
  db_delete('ad_type')
    ->condition('type', $type)
    ->execute();

  // Notify the field API that this bundle has been destroyed.
  field_attach_delete_bundle('ad', $type);

  // Notify other modules that this ad type has been deleted.
  module_invoke_all('ad_type_delete', $ad_type);
}