MediaWiki master
MediaWiki\RecentChanges\ChangesListQuery\BasicJoin Class Reference

A simple join with a fixed join condition. More...

Inherits MediaWiki\RecentChanges\ChangesListQuery\ChangesListJoinModule.

Inherited by MediaWiki\RecentChanges\ChangesListQuery\SlotsJoin, and MediaWiki\RecentChanges\ChangesListQuery\WatchlistJoin.

Collaboration diagram for MediaWiki\RecentChanges\ChangesListQuery\BasicJoin:

Public Member Functions

 __construct (string $tableName, ?string $defaultAlias, $conds, $dependencies=[],)
 
 alias (JoinDependencyProvider $provider, string $alias)
 Add or retrieve an instance of the join with the given table alias.
Parameters
JoinDependencyProvider$provider
string$alias
Returns
ChangesListJoinBuilder

 
 forConds (JoinDependencyProvider $provider)
 Declare that the join is required to provide fields for the WHERE clause.Add or retrieve the default instance of the join.
Parameters
JoinDependencyProvider$provider
Returns
ChangesListJoinBuilder

 
 forFields (JoinDependencyProvider $provider)
 Declare that the join is required to provide fields in the SELECT clause.Add or retrieve the default instance of the join.
Parameters
JoinDependencyProvider$provider
Returns
ChangesListJoinBuilder

 
 prepare (SelectQueryBuilder $sqb)
 Add all registered instances of the join to a SELECT query.
Parameters
SelectQueryBuilder$sqb

 

Protected Member Functions

 getExtraConds (?string $alias)
 Subclasses may override this to add to the ON clause.
 

Protected Attributes

ChangesListJoinBuilder[] $instances = []
 

Detailed Description

A simple join with a fixed join condition.

Since
1.45

Definition at line 13 of file BasicJoin.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\RecentChanges\ChangesListQuery\BasicJoin::__construct ( string $tableName,
?string $defaultAlias,
$conds,
$dependencies = [] )
Parameters
string$tableNameThe table name, and the module name.
string | null$defaultAliasThe alias to use if none was specified, or an empty string or null for no alias.
string|(IExpression|string)[]$conds The conditions for the ON clause
string | string[]$dependenciesTable names which must also be included in the query if this table is included. Each table must also be the name of a registered join module.

Definition at line 32 of file BasicJoin.php.

Member Function Documentation

◆ alias()

MediaWiki\RecentChanges\ChangesListQuery\BasicJoin::alias ( JoinDependencyProvider $provider,
string $alias )

Add or retrieve an instance of the join with the given table alias.

Parameters
JoinDependencyProvider$provider
string$alias
Returns
ChangesListJoinBuilder

Implements MediaWiki\RecentChanges\ChangesListQuery\ChangesListJoinModule.

Definition at line 63 of file BasicJoin.php.

◆ forConds()

MediaWiki\RecentChanges\ChangesListQuery\BasicJoin::forConds ( JoinDependencyProvider $provider)

Declare that the join is required to provide fields for the WHERE clause.Add or retrieve the default instance of the join.

Parameters
JoinDependencyProvider$provider
Returns
ChangesListJoinBuilder

Implements MediaWiki\RecentChanges\ChangesListQuery\ChangesListJoinModule.

Definition at line 54 of file BasicJoin.php.

References MediaWiki\RecentChanges\ChangesListQuery\JoinDependencyProvider\joinForConds().

◆ forFields()

MediaWiki\RecentChanges\ChangesListQuery\BasicJoin::forFields ( JoinDependencyProvider $provider)

Declare that the join is required to provide fields in the SELECT clause.Add or retrieve the default instance of the join.

Parameters
JoinDependencyProvider$provider
Returns
ChangesListJoinBuilder

Implements MediaWiki\RecentChanges\ChangesListQuery\ChangesListJoinModule.

Definition at line 45 of file BasicJoin.php.

References MediaWiki\RecentChanges\ChangesListQuery\JoinDependencyProvider\joinForFields().

◆ getExtraConds()

MediaWiki\RecentChanges\ChangesListQuery\BasicJoin::getExtraConds ( ?string $alias)
protected

Subclasses may override this to add to the ON clause.

Parameters
?string$alias
Returns
array

Reimplemented in MediaWiki\RecentChanges\ChangesListQuery\SlotsJoin, and MediaWiki\RecentChanges\ChangesListQuery\WatchlistJoin.

Definition at line 99 of file BasicJoin.php.

◆ prepare()

MediaWiki\RecentChanges\ChangesListQuery\BasicJoin::prepare ( SelectQueryBuilder $sqb)

Add all registered instances of the join to a SELECT query.

Parameters
SelectQueryBuilder$sqb

Implements MediaWiki\RecentChanges\ChangesListQuery\ChangesListJoinModule.

Definition at line 69 of file BasicJoin.php.

Member Data Documentation

◆ $instances

ChangesListJoinBuilder [] MediaWiki\RecentChanges\ChangesListQuery\BasicJoin::$instances = []
protected

Definition at line 15 of file BasicJoin.php.


The documentation for this class was generated from the following file: