/** * Overriden to add settings. * * @param DatabaseConnection $connection * @param mixed $name * @param mixed $sane */ public function __construct(DatabaseConnection $connection, $name = NULL, $settings = NULL) { $this->settings = $settings; $this->connection = $connection; // If there is no transaction depth, then no transaction has started. Name // the transaction 'drupal_transaction'. 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 (empty($name)) { $this->name = 'savepoint_' . $depth; } else { $this->name = $name; } $this->connection->pushTransaction($this->name, $settings); }