MediaWiki  master
MediaWiki\DAO Namespace Reference

Classes

interface  WikiAwareEntity
 Marker interface for entities aware of the wiki they belong to. More...
 

Functions

 assertWiki ( $wikiId)
 Throws if $wikiId is not the same as this entity wiki. More...
 
 assertWikiIdParam ( $wikiId)
 Asserts correct $wikiId parameter was passed. More...
 
 deprecateInvalidCrossWiki ( $wikiId, string $since)
 Emits a deprecation warning $since version if $wikiId is not the same as this wiki. More...
 

Variables

trait WikiAwareEntityTrait
 

Function Documentation

◆ assertWiki()

MediaWiki\DAO\assertWiki (   $wikiId)

Throws if $wikiId is not the same as this entity wiki.

Parameters
string | false$wikiIdThe wiki ID expected by the caller.
Exceptions
PreconditionException

Definition at line 55 of file WikiAwareEntityTrait.php.

Referenced by WikiPage\getLatest(), MediaWiki\Block\DatabaseBlock\setBlocker(), and MediaWiki\Block\AbstractBlock\setTarget().

◆ assertWikiIdParam()

MediaWiki\DAO\assertWikiIdParam (   $wikiId)
protected

Asserts correct $wikiId parameter was passed.

Parameters
string | false$wikiId

Definition at line 89 of file WikiAwareEntityTrait.php.

Referenced by MediaWiki\User\UserIdentityValue\__construct(), MediaWiki\Page\PageReferenceValue\__construct(), and MediaWiki\Revision\RevisionRecord\__construct().

◆ deprecateInvalidCrossWiki()

MediaWiki\DAO\deprecateInvalidCrossWiki (   $wikiId,
string  $since 
)
protected

Emits a deprecation warning $since version if $wikiId is not the same as this wiki.

Parameters
string | false$wikiId
string$since

Definition at line 71 of file WikiAwareEntityTrait.php.

References wfDeprecatedMsg().

Referenced by MediaWiki\Revision\RevisionRecord\getId(), MediaWiki\Revision\RevisionRecord\getPageId(), and MediaWiki\Revision\RevisionRecord\getParentId().

Variable Documentation

◆ WikiAwareEntityTrait

trait MediaWiki::DAO\WikiAwareEntityTrait
Initial value:
{
abstract public function getWikiId()

Definition at line 32 of file WikiAwareEntityTrait.php.