wiki.techinc.nl/includes/LinkTarget.php
addshore 1c63abcda3 Add LinkTarget interface
To be used by things that do not care if they are
passed a Title or TitleValue so long as it has a
dbkey, namespace, possible fragment and text

Example uses include:
 LinkBatch::addObj
 MediaWikiPageLinkRenderer methods
 MediaWikiTitleCodec methods
 PageLinkRenderer methods
 TitleFormatter methods

Change-Id: I2aa1a82129bb01155924a8e6a403c7a47391432f
2016-01-29 12:48:21 +01:00

41 lines
726 B
PHP

<?php
/**
* @author Addshore
*
* @since 1.27
*/
interface LinkTarget {
/**
* Get the namespace index
*
* @return int Namespace index
*/
public function getNamespace();
/**
* Get the link fragment (i.e.\ the bit after the #) in text form
*
* @return string link fragment
*/
public function getFragment();
/**
* Get the main part with underscores
*
* @return string Main part of the link, with underscores (for use in hrf attributes)
*/
public function getDBkey();
/**
* Returns the link in text form,
* without namespace prefix or fragment.
*
* This is computed from the DB key by replacing any underscores with spaces.
*
* @return string
*/
public function getText();
}