40 private $namespaceName;
52 public function __construct( $namespaceId, $namespaceName, $pageName ) {
53 if ( $namespaceId ===
null ) {
54 $this->namespaceId =
null;
56 $this->namespaceId = intval( $namespaceId );
58 $this->namespaceName = str_replace(
' ',
'_', $namespaceName );
59 $this->pageName = str_replace(
' ',
'_', $pageName );
67 return $this->namespaceId !==
null;
75 if ( $this->namespaceId ===
null ) {
76 throw new RuntimeException(
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;
124class_alias( ForeignTitle::class,
'ForeignTitle' );