connection = $connection; $this->state_bypass = $this->connection->bypassQueryPreprocess; $this->state_direct = $this->connection->directQuery; $this->statement_caching = $this->connection->statementCaching; if ($bypass_queries !== NULL) { $this->connection->bypassQueryPreprocess = $bypass_queries; } if ($direct_query !== NULL) { $this->connection->directQuery = $direct_query; } if ($statement_caching !== NULL) { $this->connection->statementCaching = $statement_caching; } } public function __destruct() { // Restore previous driver configuration. $this->connection->bypassQueryPreprocess = $this->state_bypass; $this->connection->directQuery = $this->state_direct; $this->connection->statementCaching = $this->statement_caching; } }