* @param array $params Additional parameters include:
* - keywordTableMap : Map of reserved table names to alternative table names to use
*/
- function __construct( array $params ) {
+ public function __construct( array $params ) {
$this->keywordTableMap = $params['keywordTableMap'] ?? [];
$params['tablePrefix'] = strtoupper( $params['tablePrefix'] );
parent::__construct( $params );
"and database)\n" );
}
+ if ( $schema !== null ) {
+ // We use the *database* aspect of $domain for schema, not the domain schema
+ throw new DBExpectedError(
+ $this,
+ __CLASS__ . ": cannot use schema '$schema'; " .
+ "the database component '$dbName' is actually interpreted as the Oracle schema."
+ );
+ }
+
$this->close();
$this->user = $user;
$this->password = $password;
* @param IResultWrapper|ORAResult $res
*/
function freeResult( $res ) {
- if ( $res instanceof ResultWrapper ) {
- $res = $res->result;
- }
-
- $res->free();
+ ResultWrapper::unwrap( $res )->free();
}
/**
* @return stdClass|bool
*/
function fetchObject( $res ) {
- if ( $res instanceof ResultWrapper ) {
- $res = $res->result;
- }
-
- return $res->fetchObject();
+ return ResultWrapper::unwrap( $res )->fetchObject();
}
/**
* @return stdClass|bool
*/
function fetchRow( $res ) {
- if ( $res instanceof ResultWrapper ) {
- $res = $res->result;
- }
-
- return $res->fetchRow();
+ return ResultWrapper::unwrap( $res )->fetchRow();
}
/**
* @return int
*/
function numRows( $res ) {
- if ( $res instanceof ResultWrapper ) {
- $res = $res->result;
- }
-
- return $res->numRows();
+ return ResultWrapper::unwrap( $res )->numRows();
}
/**
* @return int
*/
function numFields( $res ) {
- if ( $res instanceof ResultWrapper ) {
- $res = $res->result;
- }
-
- return $res->numFields();
+ return ResultWrapper::unwrap( $res )->numFields();
}
function fieldName( $stmt, $n ) {
if ( $res instanceof ORAResult ) {
$res->seek( $row );
} else {
- $res->result->seek( $row );
+ ResultWrapper::unwrap( $res )->seek( $row );
}
}
protected function doSelectDomain( DatabaseDomain $domain ) {
if ( $domain->getSchema() !== null ) {
// We use the *database* aspect of $domain for schema, not the domain schema
- throw new DBExpectedError( $this, __CLASS__ . ": domain schemas are not supported." );
+ throw new DBExpectedError(
+ $this,
+ __CLASS__ . ": domain '{$domain->getId()}' has a schema component; " .
+ "the database component is actually interpreted as the Oracle schema."
+ );
}
$database = $domain->getDatabase();