MediaWiki  master
Page\WikiPageFactory Class Reference
Collaboration diagram for Page\WikiPageFactory:

Public Member Functions

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

Private Attributes

ILoadBalancer $loadBalancer
 
TitleFactory $titleFactory
 
WikiPageFactoryHook $wikiPageFactoryHookRunner
 

Detailed Description

Since
1.36

Definition at line 20 of file WikiPageFactory.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 36 of file WikiPageFactory.php.

References Page\WikiPageFactory\$loadBalancer, Page\WikiPageFactory\$titleFactory, and Page\WikiPageFactory\$wikiPageFactoryHookRunner.

Member Function Documentation

◆ newFromID()

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 127 of file WikiPageFactory.php.

References WikiPage\convertSelectType(), DBAccessObjectUtils\getDBOptions(), WikiPage\getQueryInfo(), and Page\WikiPageFactory\newFromRow().

◆ newFromLinkTarget()

Page\WikiPageFactory::newFromLinkTarget ( LinkTarget  $title)

Create a WikiPage object from a link target.

Parameters
LinkTarget$title
Returns
WikiPage

Definition at line 96 of file WikiPageFactory.php.

References $title, and Page\WikiPageFactory\newFromTitle().

◆ newFromRow()

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 111 of file WikiPageFactory.php.

References Page\WikiPageFactory\newFromTitle().

Referenced by Page\WikiPageFactory\newFromID().

◆ newFromTitle()

Page\WikiPageFactory::newFromTitle ( PageIdentity  $pageIdentity)

Member Data Documentation

◆ $loadBalancer

ILoadBalancer Page\WikiPageFactory::$loadBalancer
private

Definition at line 29 of file WikiPageFactory.php.

Referenced by Page\WikiPageFactory\__construct().

◆ $titleFactory

TitleFactory Page\WikiPageFactory::$titleFactory
private

Definition at line 23 of file WikiPageFactory.php.

Referenced by Page\WikiPageFactory\__construct().

◆ $wikiPageFactoryHookRunner

WikiPageFactoryHook Page\WikiPageFactory::$wikiPageFactoryHookRunner
private

Definition at line 26 of file WikiPageFactory.php.

Referenced by Page\WikiPageFactory\__construct().


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