MediaWiki REL1_31
NamespaceImportTitleFactory.php
Go to the documentation of this file.
1<?php
28 protected $ns;
29
33 public function __construct( $ns ) {
34 if ( !MWNamespace::exists( $ns ) ) {
35 throw new MWException( "Namespace $ns doesn't exist on this wiki" );
36 }
37 $this->ns = $ns;
38 }
39
48 public function createTitleFromForeignTitle( ForeignTitle $foreignTitle ) {
49 return Title::makeTitleSafe( $this->ns, $foreignTitle->getText() );
50 }
51}
A simple, immutable structure to hold the title of a page on a foreign MediaWiki installation.
MediaWiki exception.
A class to convert page titles on a foreign wiki (ForeignTitle objects) into page titles on the local...
createTitleFromForeignTitle(ForeignTitle $foreignTitle)
Determines which local title best corresponds to the given foreign title.
Represents an object that can convert page titles on a foreign wiki (ForeignTitle objects) into page ...