Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4159121
DatabaseRepository.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
829 B
Referenced Files
None
Subscribers
None
DatabaseRepository.php
View Options
<?php
namespace
MediaWiki\Extension\OAuth\Repository
;
use
MediaWiki\Extension\OAuth\Backend\Utils
;
use
Wikimedia\Rdbms\IDatabase
;
abstract
class
DatabaseRepository
{
/**
* @param int $index
* @return IDatabase
*/
public
function
getDB
(
$index
=
DB_REPLICA
)
{
return
Utils
::
getCentralDB
(
$index
);
}
/**
* Is given identifier stored in the DB
*
* @param string $identifier
* @return bool
*/
public
function
identifierExists
(
$identifier
)
{
return
$this
->
getDB
()->
newSelectQueryBuilder
()
->
select
(
$this
->
getIdentifierField
()
)
->
from
(
$this
->
getTableName
()
)
->
where
(
[
$this
->
getIdentifierField
()
=>
$identifier
]
)
->
caller
(
__METHOD__
)
->
fetchRow
()
!==
false
;
}
abstract
protected
function
getTableName
():
string
;
abstract
protected
function
getIdentifierField
():
string
;
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Aug 19 2026, 23:44 (9 w, 1 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ab/ec/176156f4e2e4c16613ef59156187
Default Alt Text
DatabaseRepository.php (829 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment