Page MenuHomeWickedGov Phorge

DatabaseRepository.php
No OneTemporary

Size
829 B
Referenced Files
None
Subscribers
None

DatabaseRepository.php

<?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

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)

Event Timeline