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 (Title $title)
 Create a WikiPage object from a title. More...
 

Private Attributes

ILoadBalancer $loadBalancer
 
TitleFactory $titleFactory
 
WikiPageFactoryHook $wikiPageFactoryHookRunner
 

Detailed Description

Since
1.36

Definition at line 19 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 35 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 master database
Returns
WikiPage|null Null when no page exists with that ID

Definition at line 118 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 87 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
object$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 master DB
  • "forupdate" or WikiPage::READ_LOCKING: from the master DB using SELECT FOR UPDATE
Returns
WikiPage

Definition at line 102 of file WikiPageFactory.php.

References Page\WikiPageFactory\newFromTitle().

Referenced by Page\WikiPageFactory\newFromID().

◆ newFromTitle()

Page\WikiPageFactory::newFromTitle ( Title  $title)

Create a WikiPage object from a title.

Parameters
Title$title
Returns
WikiPage

Definition at line 52 of file WikiPageFactory.php.

References $title, NS_CATEGORY, NS_FILE, and NS_MEDIA.

Referenced by Page\WikiPageFactory\newFromLinkTarget(), and Page\WikiPageFactory\newFromRow().

Member Data Documentation

◆ $loadBalancer

ILoadBalancer Page\WikiPageFactory::$loadBalancer
private

Definition at line 28 of file WikiPageFactory.php.

Referenced by Page\WikiPageFactory\__construct().

◆ $titleFactory

TitleFactory Page\WikiPageFactory::$titleFactory
private

Definition at line 22 of file WikiPageFactory.php.

Referenced by Page\WikiPageFactory\__construct().

◆ $wikiPageFactoryHookRunner

WikiPageFactoryHook Page\WikiPageFactory::$wikiPageFactoryHookRunner
private

Definition at line 25 of file WikiPageFactory.php.

Referenced by Page\WikiPageFactory\__construct().


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