/** @var IDatabase|null Live connection handle */
private $conn;
- /** @var array|null */
+ /** @var array|null N-tuple of (server index, group, DatabaseDomain|string) */
private $params;
const FLD_INDEX = 0;
const FLD_GROUP = 1;
- const FLD_WIKI = 2;
+ const FLD_DOMAIN = 2;
/**
* @param ILoadBalancer $lb
- * @param IDatabase|array $conn Connection or (server index, group, wiki ID)
+ * @param IDatabase|array $conn Connection or (server index, group, DatabaseDomain|string)
*/
public function __construct( ILoadBalancer $lb, $conn ) {
$this->lb = $lb;
if ( $conn instanceof IDatabase ) {
$this->conn = $conn; // live handle
- } elseif ( count( $conn ) >= 3 && $conn[self::FLD_WIKI] !== false ) {
+ } elseif ( count( $conn ) >= 3 && $conn[self::FLD_DOMAIN] !== false ) {
$this->params = $conn;
} else {
throw new InvalidArgumentException( "Missing lazy connection arguments." );
return $this->__call( __FUNCTION__, func_get_args() );
}
- public function getWikiID() {
+ public function getDomainID() {
if ( $this->conn === null ) {
- // Avoid triggering a connection
- return $this->params[self::FLD_WIKI];
+ $domain = $this->params[self::FLD_DOMAIN];
+ // Avoid triggering a database connection
+ return $domain instanceof DatabaseDomain ? $domain->getId() : $domain;
}
return $this->__call( __FUNCTION__, func_get_args() );
}
+ public function getWikiID() {
+ return $this->getDomainID();
+ }
+
public function getType() {
return $this->__call( __FUNCTION__, func_get_args() );
}
return $this->__call( __FUNCTION__, func_get_args() );
}
- public function makeList( $a, $mode = LIST_COMMA ) {
+ public function makeList( $a, $mode = self::LIST_COMMA ) {
return $this->__call( __FUNCTION__, func_get_args() );
}
return $this->__call( __FUNCTION__, func_get_args() );
}
+ public function aggregateValue( $valuedata, $valuename = 'value' ) {
+ return $this->__call( __FUNCTION__, func_get_args() );
+ }
+
public function bitNot( $field ) {
return $this->__call( __FUNCTION__, func_get_args() );
}
return $this->__call( __FUNCTION__, func_get_args() );
}
+ public function buildStringCast( $field ) {
+ return $this->__call( __FUNCTION__, func_get_args() );
+ }
+
public function selectDB( $db ) {
return $this->__call( __FUNCTION__, func_get_args() );
}
return $this->__call( __FUNCTION__, func_get_args() );
}
- public function getSlavePos() {
+ public function getReplicaPos() {
return $this->__call( __FUNCTION__, func_get_args() );
}
return $this->__call( __FUNCTION__, func_get_args() );
}
- public function onTransactionResolution( callable $callback ) {
+ public function onTransactionResolution( callable $callback, $fname = __METHOD__ ) {
return $this->__call( __FUNCTION__, func_get_args() );
}
- public function onTransactionIdle( callable $callback ) {
+ public function onTransactionIdle( callable $callback, $fname = __METHOD__ ) {
return $this->__call( __FUNCTION__, func_get_args() );
}
- public function onTransactionPreCommitOrIdle( callable $callback ) {
+ public function onTransactionPreCommitOrIdle( callable $callback, $fname = __METHOD__ ) {
return $this->__call( __FUNCTION__, func_get_args() );
}
return $this->__call( __FUNCTION__, func_get_args() );
}
+ public function setTableAliases( array $aliases ) {
+ return $this->__call( __FUNCTION__, func_get_args() );
+ }
+
/**
* Clean up the connection when out of scope
*/