MediaWiki REL1_39
MediaWiki\Page\WikiPageFactory Class Reference

Service for creating WikiPage objects. More...

Public Member Functions

 __construct (TitleFactory $titleFactory, WikiPageFactoryHook $wikiPageFactoryHookRunner, ILoadBalancer $loadBalancer)
 
 newFromID ( $id, $from='fromdb')
 Create a WikiPage object from a page ID.
 
 newFromLinkTarget (LinkTarget $title)
 Create a WikiPage object from a link target.
 
 newFromRow ( $row, $from='fromdb')
 Create a WikiPage object from a database row.
 
 newFromTitle (PageIdentity $pageIdentity)
 Create a WikiPage object from a title.
 

Detailed Description

Service for creating WikiPage objects.

Since
1.36

Definition at line 21 of file WikiPageFactory.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Page\WikiPageFactory::__construct ( TitleFactory $titleFactory,
WikiPageFactoryHook $wikiPageFactoryHookRunner,
ILoadBalancer $loadBalancer )
Parameters
TitleFactory$titleFactory
WikiPageFactoryHook$wikiPageFactoryHookRunner
ILoadBalancer$loadBalancer

Definition at line 34 of file WikiPageFactory.php.

Member Function Documentation

◆ newFromID()

MediaWiki\Page\WikiPageFactory::newFromID ( $id,
$from = 'fromdb' )

Create a WikiPage object from a page ID.

Parameters
int$idArticle ID to load
string | int$fromOne of the following values:
  • "fromdb" or WikiPage::READ_NORMAL to select from a replica DB
  • "fromdbmaster" or WikiPage::READ_LATEST to select from the primary database
Returns
WikiPage|null Null when no page exists with that ID

Definition at line 126 of file WikiPageFactory.php.

◆ newFromLinkTarget()

MediaWiki\Page\WikiPageFactory::newFromLinkTarget ( LinkTarget $title)

Create a WikiPage object from a link target.

Parameters
LinkTarget$title
Returns
WikiPage

Definition at line 95 of file WikiPageFactory.php.

◆ newFromRow()

MediaWiki\Page\WikiPageFactory::newFromRow ( $row,
$from = 'fromdb' )

Create a WikiPage object from a database row.

Parameters
stdClass$rowDatabase row containing at least fields returned by getQueryInfo().
string | int$fromSource of $data:
  • "fromdb" or WikiPage::READ_NORMAL: from a replica DB
  • "fromdbmaster" or WikiPage::READ_LATEST: from the primary DB
  • "forupdate" or WikiPage::READ_LOCKING: from the primary DB using SELECT FOR UPDATE
Returns
WikiPage

Definition at line 110 of file WikiPageFactory.php.

◆ newFromTitle()

MediaWiki\Page\WikiPageFactory::newFromTitle ( PageIdentity $pageIdentity)

Create a WikiPage object from a title.

Parameters
PageIdentity$pageIdentity
Returns
WikiPage

Definition at line 50 of file WikiPageFactory.php.

Referenced by MediaWiki\Page\DeletePage\__construct().


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