dbDomain = $dbDomain; $this->lb = MediaWikiServices::getInstance()->getDBLoadBalancerFactory() ->getMainLB( $dbDomain ); } /** * Returns a database connection. * * @see LoadBalancer::getConnection() * * @since 1.21 * * @param int $id Which connection to use * @param array $groups Query groups * * @return IDatabase */ protected function getConnection( $id, array $groups = [] ) { return $this->getLoadBalancer()->getConnectionRef( $id, $groups, $this->dbDomain ); } /** * Releases a database connection and makes it available for recycling. * * @see LoadBalancer::reuseConnection() * * @since 1.21 * * @param IDatabase $db The database connection to release. * @deprecated Since 1.34 */ protected function releaseConnection( IDatabase $db ) { // no-op } /** * Get the database type used for read operations. * * @see MediaWikiServices::getInstance()->getDBLoadBalancer * * @since 1.21 * * @return ILoadBalancer The database load balancer object */ protected function getLoadBalancer() { return $this->lb; } }