getNamespace() ) ) { throw new MWException( "The root page you specified, $rootPage, is in a " . "namespace where subpages are not allowed" ); } $this->rootPage = $rootPage; } /** * 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. * * @param ForeignTitle $foreignTitle The ForeignTitle to convert * @return Title|null */ public function createTitleFromForeignTitle( ForeignTitle $foreignTitle ) { return Title::newFromText( $this->rootPage->getPrefixedDBkey() . '/' . $foreignTitle->getFullText() ); } }