35 private $namespaceName;
47 public function __construct( $namespaceId, $namespaceName, $pageName ) {
48 if ( $namespaceId ===
null ) {
49 $this->namespaceId =
null;
51 $this->namespaceId = intval( $namespaceId );
53 $this->namespaceName = str_replace(
' ',
'_', $namespaceName );
54 $this->pageName = str_replace(
' ',
'_', $pageName );
62 return $this->namespaceId !==
null;
71 if ( $this->namespaceId ===
null ) {
73 "Attempted to call getNamespaceId when the namespace ID is not known" );
75 return $this->namespaceId;
80 return $this->namespaceName;
85 return $this->pageName;
91 if ( $this->namespaceName ) {
92 $result .= $this->namespaceName .
':';
94 $result .= $this->pageName;
109 $name .=
'{ns' . $this->namespaceId .
'}';
113 $name .= $this->namespaceName .
':' . $this->pageName;
A simple, immutable structure to hold the title of a page on a foreign MediaWiki installation.
__toString()
Returns a string representation of the title, for logging.
__construct( $namespaceId, $namespaceName, $pageName)
Creates a new ForeignTitle object.
isNamespaceIdKnown()
Do we know the namespace ID of the page on the foreign wiki?