MediaWiki
master
|
Helper class for DAO classes. More...
Static Public Member Functions | |
static | getDBFromIndex (IConnectionProvider $dbProvider, int $index) |
Takes $index from ::getDBOptions() and return proper Database object. More... | |
static | getDBOptions ( $bitfield) |
Get an appropriate DB index, options, and fallback DB index for a query. More... | |
static | hasFlags ( $bitfield, $flags) |
Additional Inherited Members | |
![]() | |
const | READ_NONE = -1 |
Constants for object loading bitfield flags (higher => higher QoS) More... | |
|
static |
Takes $index from ::getDBOptions() and return proper Database object.
Use of this function (and getDBOptions) is discouraged.
IConnectionProvider | $dbProvider | |
int | $index | either DB_REPLICA or DB_PRIMARY |
Definition at line 94 of file DBAccessObjectUtils.php.
References Wikimedia\Rdbms\IConnectionProvider\getPrimaryDatabase().
Referenced by MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider\testUserExists(), and MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider\testUserExists().
|
static |
Get an appropriate DB index, options, and fallback DB index for a query.
The fallback DB index and options are to be used if the entity is not found with the initial DB index, typically querying the primary DB to avoid lag
int | $bitfield | Bitfield of IDBAccessObject::READ_* constants |
Definition at line 55 of file DBAccessObjectUtils.php.
References DB_PRIMARY, and DB_REPLICA.
Referenced by MediaWiki\Revision\RevisionStore\getRecentChange(), MediaWiki\User\User\idForName(), MediaWiki\User\User\load(), MediaWiki\User\User\loadFromDatabase(), WikiPage\loadPageData(), MediaWiki\User\UserFactory\newFromConfirmationCode(), MediaWiki\Title\Title\newFromID(), MediaWiki\Page\WikiPageFactory\newFromID(), MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider\testUserExists(), and MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider\testUserExists().
|
static |
int | $bitfield | |
int | $flags | IDBAccessObject::READ_* constant |
Definition at line 38 of file DBAccessObjectUtils.php.
Referenced by MediaWiki\User\User\loadFromId().