MediaWiki
1.32.5
|
Represents a page (or page fragment) title within MediaWiki. More...
Public Member Functions | |
__construct ( $namespace, $dbkey, $fragment='', $interwiki='') | |
Constructs a TitleValue. More... | |
__toString () | |
Returns a string representation of the title, for logging. More... | |
createFragmentTarget ( $fragment) | |
Creates a new TitleValue for a different fragment of the same page. More... | |
getDBkey () | |
Returns the title's DB key, as supplied to the constructor, without namespace prefix or fragment. More... | |
getFragment () | |
getInterwiki () | |
Returns the interwiki part. More... | |
getNamespace () | |
getText () | |
Returns the title in text form, without namespace prefix or fragment. More... | |
hasFragment () | |
inNamespace ( $ns) | |
isExternal () | |
Whether it has an interwiki part. More... | |
Public Attributes | |
string | $prefixedText = null |
Text form including namespace/interwiki, initialised on demand. More... | |
Protected Attributes | |
string | $dbkey |
string | $fragment |
string | $interwiki |
int | $namespace |
Represents a page (or page fragment) title within MediaWiki.
Definition at line 36 of file TitleValue.php.
TitleValue::__construct | ( | $namespace, | |
$dbkey, | |||
$fragment = '' , |
|||
$interwiki = '' |
|||
) |
Constructs a TitleValue.
int | $namespace | The namespace ID. This is not validated. |
string | $dbkey | The page title in valid DBkey form. No normalization is applied. |
string | $fragment | The fragment title. Use '' to represent the whole page. No validation or normalization is applied. |
string | $interwiki | The interwiki component |
InvalidArgumentException |
Definition at line 89 of file TitleValue.php.
References $dbkey, $fragment, $interwiki, and $namespace.
TitleValue::__toString | ( | ) |
Returns a string representation of the title, for logging.
This is purely informative and must not be used programmatically. Use the appropriate TitleFormatter to generate the correct string representation for a given use.
Implements MediaWiki\Linker\LinkTarget.
Definition at line 219 of file TitleValue.php.
TitleValue::createFragmentTarget | ( | $fragment | ) |
Creates a new TitleValue for a different fragment of the same page.
string | $fragment | The fragment name, or "" for the entire page. |
Implements MediaWiki\Linker\LinkTarget.
Definition at line 182 of file TitleValue.php.
References $fragment.
TitleValue::getDBkey | ( | ) |
Returns the title's DB key, as supplied to the constructor, without namespace prefix or fragment.
Implements MediaWiki\Linker\LinkTarget.
Definition at line 154 of file TitleValue.php.
References $dbkey.
TitleValue::getFragment | ( | ) |
Implements MediaWiki\Linker\LinkTarget.
Definition at line 135 of file TitleValue.php.
References $fragment.
TitleValue::getInterwiki | ( | ) |
Returns the interwiki part.
Implements MediaWiki\Linker\LinkTarget.
Definition at line 207 of file TitleValue.php.
References $interwiki.
TitleValue::getNamespace | ( | ) |
Implements MediaWiki\Linker\LinkTarget.
Definition at line 118 of file TitleValue.php.
References $namespace.
TitleValue::getText | ( | ) |
Returns the title in text form, without namespace prefix or fragment.
This is computed from the DB key by replacing any underscores with spaces.
Implements MediaWiki\Linker\LinkTarget.
Definition at line 170 of file TitleValue.php.
TitleValue::hasFragment | ( | ) |
Implements MediaWiki\Linker\LinkTarget.
Definition at line 143 of file TitleValue.php.
TitleValue::inNamespace | ( | $ns | ) |
int | $ns |
Implements MediaWiki\Linker\LinkTarget.
Definition at line 127 of file TitleValue.php.
TitleValue::isExternal | ( | ) |
Whether it has an interwiki part.
Implements MediaWiki\Linker\LinkTarget.
Definition at line 197 of file TitleValue.php.
|
protected |
This class is immutable. Use the getter for access.
Definition at line 48 of file TitleValue.php.
Referenced by __construct(), and getDBkey().
|
protected |
This class is immutable. Use the getter for access.
Definition at line 54 of file TitleValue.php.
Referenced by __construct(), __toString(), createFragmentTarget(), and getFragment().
|
protected |
This class is immutable. Use the getter for access.
Definition at line 60 of file TitleValue.php.
Referenced by __construct(), and getInterwiki().
|
protected |
This class is immutable. Use the getter for access.
Definition at line 42 of file TitleValue.php.
Referenced by __construct(), and getNamespace().
string TitleValue::$prefixedText = null |
Text form including namespace/interwiki, initialised on demand.
Only public to share cache with TitleFormatter
Definition at line 70 of file TitleValue.php.