MediaWiki master
MediaWiki\Title\SubpageImportTitleFactory Class Reference

A class to convert page titles on a foreign wiki (ForeignTitle objects) into page titles on the local wiki (Title objects), placing all pages as subpages of a given root page. More...

Inherits MediaWiki\Title\ImportTitleFactory.

Collaboration diagram for MediaWiki\Title\SubpageImportTitleFactory:

Public Member Functions

 __construct (NamespaceInfo $namespaceInfo, TitleFactory $titleFactory, Title $rootPage)
 
 createTitleFromForeignTitle (ForeignTitle $foreignTitle)
 Determines which local title best corresponds to the given foreign title.
 

Detailed Description

A class to convert page titles on a foreign wiki (ForeignTitle objects) into page titles on the local wiki (Title objects), placing all pages as subpages of a given root page.

Definition at line 30 of file SubpageImportTitleFactory.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Title\SubpageImportTitleFactory::__construct ( NamespaceInfo  $namespaceInfo,
TitleFactory  $titleFactory,
Title  $rootPage 
)
Parameters
NamespaceInfo$namespaceInfo
TitleFactory$titleFactory
Title$rootPageThe root page under which all pages should be created

Definition at line 42 of file SubpageImportTitleFactory.php.

References MediaWiki\Title\Title\getNamespace(), and MediaWiki\Title\NamespaceInfo\hasSubpages().

Member Function Documentation

◆ createTitleFromForeignTitle()

MediaWiki\Title\SubpageImportTitleFactory::createTitleFromForeignTitle ( ForeignTitle  $foreignTitle)

Determines which local title best corresponds to the given foreign title.

If such a title can't be found or would be locally invalid, null is returned.

Parameters
ForeignTitle$foreignTitleThe ForeignTitle to convert
Returns
Title|null

Implements MediaWiki\Title\ImportTitleFactory.

Definition at line 63 of file SubpageImportTitleFactory.php.

References MediaWiki\Title\ForeignTitle\getFullText().


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