You are here

public function EntityType::delete in Entity Construction Kit (ECK) 7.3

Same name and namespace in other branches
  1. 7.2 eck.classes.inc \EntityType::delete()

Delete.

Overrides DBObject::delete

File

./eck.classes.inc, line 419
Classes for all the different objects used in ECK.

Class

EntityType

Code

public function delete() {

  // Delete all the bundles from this entity type.
  $bundles = Bundle::loadByEntityType($this);
  foreach ($bundles as $bundle) {
    $bundle
      ->delete();
  }
  parent::delete();
  db_drop_table('eck_' . $this->name);

  // Allow other modules to respond to the deletion of entity types.
  module_invoke_all('eck_entity_type_delete', $this);
  global $_eck_entity_types_cache;
  $cache_enabled = isset($_eck_entity_types_cache) ? TRUE : FALSE;
  if ($cache_enabled) {
    $_eck_entity_types_cache
      ->reset();
  }
  variable_set('eck_clear_caches', TRUE);
}