public function UcAddressesEntityController::save in Ubercart Addresses 7
Implements EntityAPIControllerInterface::save().
Uses UcAddressesAddress save logics.
Parameters
$transaction: (optional) a DatabaseTransaction object to use. Allows overrides to pass in their transaction object.
Return value
void
Overrides EntityAPIController::save
File
- class/
uc_addresses.entity.inc, line 95 - Entity integration code.
Class
- UcAddressesEntityController
- Ubercart Addresses entity controller class.
Code
public function save($entity, DatabaseTransaction $transaction = NULL) {
$transaction = isset($transaction) ? $transaction : db_transaction();
try {
$result = $entity
->save();
// Ignore slave server temporarily.
db_ignore_slave();
unset($entity->is_new);
unset($entity->original);
} catch (Exception $e) {
$transaction
->rollback();
watchdog_exception($this->entityType, $e);
throw $e;
}
return $result;
}