if (!
$depth =
$connection->
transactionDepth()) { $this->name = 'drupal_transaction';
} // Within transactions, savepoints are used. Each savepoint requires a
// name. So if no name is present we need to create one.
elseif (!
$name) { $this->name = 'savepoint_' .
$depth;
} else { $this->name =
$name;
} $this->connection->
pushTransaction($this->name
);
} public function __destruct() { // If we rolled back then the transaction would have already been popped.
if (!
$this->rolledBack
) { $this->connection->
popTransaction($this->name
);
} } /**
* Retrieves the name of the transaction or savepoint.
*/