39 private $namespaceName;
51 public function __construct( $namespaceId, $namespaceName, $pageName ) {
52 if ( $namespaceId ===
null ) {
53 $this->namespaceId =
null;
55 $this->namespaceId = intval( $namespaceId );
57 $this->namespaceName = str_replace(
' ',
'_', $namespaceName );
58 $this->pageName = str_replace(
' ',
'_', $pageName );
66 return $this->namespaceId !==
null;
75 if ( $this->namespaceId ===
null ) {
77 "Attempted to call getNamespaceId when the namespace ID is not known" );
79 return $this->namespaceId;
84 return $this->namespaceName;
89 return $this->pageName;
95 if ( $this->namespaceName ) {
96 $result .= $this->namespaceName .
':';
98 $result .= $this->pageName;
113 $name .=
'{ns' . $this->namespaceId .
'}';
117 $name .= $this->namespaceName .
':' . $this->pageName;
127class_alias( ForeignTitle::class,
'ForeignTitle' );