You are here

public function UcAddressesEntityController::delete in Ubercart Addresses 7

Implements EntityAPIControllerInterface::delete().

Overridden to follow Ubercart Addresses logics.

Return value

void

Overrides EntityAPIController::delete

File

class/uc_addresses.entity.inc, line 120
Entity integration code.

Class

UcAddressesEntityController
Ubercart Addresses entity controller class.

Code

public function delete($ids, DatabaseTransaction $transaction = NULL) {
  $entities = $ids ? $this
    ->load($ids) : FALSE;
  if (!$entities) {

    // Do nothing, in case invalid or no ids have been passed.
    return;
  }
  try {
    foreach ($entities as $entity) {
      $entity
        ->delete();
    }

    // Ignore slave server temporarily.
    db_ignore_slave();
  } catch (Exception $e) {
    if (isset($transaction)) {
      $transaction
        ->rollback();
    }
    watchdog_exception($this->entityType, $e);
    throw $e;
  }
}