MediaWiki REL1_30
NamespaceImportTitleFactory.php
Go to the documentation of this file.
1<?php
29 protected $ns;
30
34 public function __construct( $ns ) {
35 if ( !MWNamespace::exists( $ns ) ) {
36 throw new MWException( "Namespace $ns doesn't exist on this wiki" );
37 }
38 $this->ns = $ns;
39 }
40
49 public function createTitleFromForeignTitle( ForeignTitle $foreignTitle ) {
50 return Title::makeTitleSafe( $this->ns, $foreignTitle->getText() );
51 }
52}
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 ...