MediaWiki master
MediaWiki\Page\WikiPageFactory Class Reference

Service for creating WikiPage objects. More...

Public Member Functions

 __construct (TitleFactory $titleFactory, WikiPageFactoryHook $wikiPageFactoryHookRunner, IConnectionProvider $dbProvider)
 
 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,
IConnectionProvider $dbProvider )

Definition at line 26 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 IDBAccessObject::READ_NORMAL to select from a replica DB
  • "fromdbmaster" or IDBAccessObject::READ_LATEST to select from the primary database
Returns
WikiPage|null Null when no page exists with that ID

Definition at line 117 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 86 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 IDBAccessObject::READ_NORMAL: from a replica DB
  • "fromdbmaster" or IDBAccessObject::READ_LATEST: from the primary DB
  • "forupdate" or IDBAccessObject::READ_LOCKING: from the primary DB using SELECT FOR UPDATE
Returns
WikiPage

Definition at line 101 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 42 of file WikiPageFactory.php.

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


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