57 if ( !$pageIdentity->canExist() ) {
60 'The given PageIdentity {pageIdentity} does not represent a proper page',
61 [
'pageIdentity' => $pageIdentity ]
65 $ns = $pageIdentity->getNamespace();
69 $title = Title::castFromPageIdentity( $pageIdentity );
72 if ( !$this->wikiPageFactoryHookRunner->onWikiPageFactory(
$title, $page ) ) {
98 return $this->newFromTitle( $this->titleFactory->newFromLinkTarget(
$title ) );
113 $page = $this->newFromTitle( $this->titleFactory->newFromRow( $row ) );
114 $page->loadFromRow( $row, $from );
134 $from = WikiPage::convertSelectType( $from );
135 [ $index ] = DBAccessObjectUtils::getDBOptions( $from );
136 $db = $this->loadBalancer->getMaintenanceConnectionRef( $index );
137 $pageQuery = WikiPage::getQueryInfo();
138 $row = $db->selectRow(
139 $pageQuery[
'tables'], $pageQuery[
'fields'], [
'page_id' => $id ], __METHOD__,
140 [], $pageQuery[
'joins']
145 return $this->newFromRow( $row, $from );
if(!defined('MW_SETUP_CALLBACK'))
Expand dynamic defaults and shortcuts.
Helper class for DAO classes.
Exception if a PageIdentity is an invalid argument.
__construct(TitleFactory $titleFactory, WikiPageFactoryHook $wikiPageFactoryHookRunner, ILoadBalancer $loadBalancer)
WikiPageFactoryHook $wikiPageFactoryHookRunner
newFromID( $id, $from='fromdb')
Create a WikiPage object from a page ID.
newFromTitle(PageIdentity $pageIdentity)
Create a WikiPage object from a title.
newFromRow( $row, $from='fromdb')
Create a WikiPage object from a database row.
TitleFactory $titleFactory
newFromLinkTarget(LinkTarget $title)
Create a WikiPage object from a link target.
ILoadBalancer $loadBalancer
Represents a title within MediaWiki.
Special handling for category pages.
Special handling for file pages.
Class representing a MediaWiki article and history.
This is a hook handler interface, see docs/Hooks.md.
Interface for objects (potentially) representing an editable wiki page.