MediaWiki  1.33.1
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...

Inheritance diagram for SubpageImportTitleFactory:
Collaboration diagram for SubpageImportTitleFactory:

Public Member Functions

 __construct (Title $rootPage)
 
 createTitleFromForeignTitle (ForeignTitle $foreignTitle)
 Determines which local title best corresponds to the given foreign title. More...
 

Protected Attributes

Title $rootPage
 

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 26 of file SubpageImportTitleFactory.php.

Constructor & Destructor Documentation

◆ __construct()

SubpageImportTitleFactory::__construct ( Title  $rootPage)
Parameters
Title$rootPageThe root page under which all pages should be created

Definition at line 34 of file SubpageImportTitleFactory.php.

References $rootPage, Title\getNamespace(), and MWNamespace\hasSubpages().

Member Function Documentation

◆ createTitleFromForeignTitle()

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 ImportTitleFactory.

Definition at line 50 of file SubpageImportTitleFactory.php.

References ForeignTitle\getFullText(), and Title\newFromText().

Member Data Documentation

◆ $rootPage

Title SubpageImportTitleFactory::$rootPage
protected

Definition at line 28 of file SubpageImportTitleFactory.php.

Referenced by __construct().


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