wiki.techinc.nl/includes/libs/rdbms/querybuilder/JoinGroup.php
Tim Starling d06a3e049b Add SelectQueryBuilder
Add a query builder class which encapsulates the parameters to
IDatabase::select() and related functions.

Override useIndexClause() and ignoreIndexClause() in DatabaseTestHelper
so that index hints can be tested.

Bug: T243051
Change-Id: I58eec4eeb23bd7fb05b8b77d0a748f1026afee52
2020-02-07 10:10:17 +11:00

58 lines
973 B
PHP

<?php
namespace Wikimedia\Rdbms;
/**
* An object representing a parenthesized group of tables and their join
* types and conditions.
*/
class JoinGroup extends JoinGroupBase {
/** @var string */
private $alias;
/** @var int */
private $nextAutoAlias = 0;
/**
* Use SelectQueryBuilder::newJoinGroup() to create a join group
*
* @internal
* @param string $alias
*/
public function __construct( $alias ) {
$this->alias = $alias;
}
/**
* Get a table alias which is unique to the parent SelectQueryBuilder
*
* @return string
*/
protected function getAutoAlias() {
return $this->alias . '_' . ( $this->nextAutoAlias++ );
}
/**
* @internal
* @return array
*/
public function getRawTables() {
return $this->tables;
}
/**
* @internal
* @return array
*/
public function getRawJoinConds() {
return $this->joinConds;
}
/**
* @internal
* @return string
*/
public function getAlias() {
return $this->alias;
}
}