public function EntityType::delete in Entity Construction Kit (ECK) 7.2
Same name and namespace in other branches
- 7.3 eck.classes.inc \EntityType::delete()
Delete.
Overrides DBObject::delete
File
- ./
eck.classes.inc, line 434 - Classes for all the different objects used in ECK.
Class
- EntityType
- An entity type database object.
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();
}
eck_clean_up_request();
}