You are here

public function EntityAPIControllerExportable::delete in Entity API 7

Overridden to care about reverted entities.

Overrides EntityAPIController::delete

File

includes/entity.controller.inc, line 891
Provides a controller building upon the core controller but providing more features like full CRUD functionality.

Class

EntityAPIControllerExportable
A controller implementing exportables stored in the database.

Code

public function delete($ids, DatabaseTransaction $transaction = NULL) {
  $entities = $ids ? $this
    ->load($ids) : FALSE;
  if ($entities) {
    parent::delete($ids, $transaction);
    foreach ($entities as $id => $entity) {
      if (entity_has_status($this->entityType, $entity, ENTITY_IN_CODE)) {
        entity_defaults_rebuild(array(
          $this->entityType,
        ));
        break;
      }
    }
  }
}