X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flinker%2FLinkTarget.php;h=dbd97a7a028bd06d58401ed9fb072b742b316eb7;hb=f8cc99ea9885103ed4ee23b83efc003d24c98450;hp=2764f461ffd3e3c8c192ebe115d630f2f57a78e2;hpb=5fdf7d1918d6aee64fa3ece5c0d7690a10bea2c5;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/linker/LinkTarget.php b/includes/linker/LinkTarget.php index 2764f461ff..dbd97a7a02 100644 --- a/includes/linker/LinkTarget.php +++ b/includes/linker/LinkTarget.php @@ -28,13 +28,24 @@ interface LinkTarget { /** * Get the namespace index. + * @since 1.27 * * @return int Namespace index */ public function getNamespace(); + /** + * Convenience function to test if it is in the namespace + * @since 1.27 + * + * @param int $ns + * @return bool + */ + public function inNamespace( $ns ); + /** * Get the link fragment (i.e. the bit after the #) in text form. + * @since 1.27 * * @return string link fragment */ @@ -42,6 +53,7 @@ interface LinkTarget { /** * Whether the link target has a fragment + * @since 1.27 * * @return bool */ @@ -49,6 +61,7 @@ interface LinkTarget { /** * Get the main part with underscores. + * @since 1.27 * * @return string Main part of the link, with underscores (for use in href attributes) */ @@ -56,8 +69,8 @@ interface LinkTarget { /** * Returns the link in text form, without namespace prefix or fragment. - * * This is computed from the DB key by replacing any underscores with spaces. + * @since 1.27 * * @return string */ @@ -67,10 +80,27 @@ interface LinkTarget { * Creates a new LinkTarget for a different fragment of the same page. * It is expected that the same type of object will be returned, but the * only requirement is that it is a LinkTarget. + * @since 1.27 * * @param string $fragment The fragment name, or "" for the entire page. * * @return LinkTarget */ public function createFragmentTarget( $fragment ); + + /** + * Whether this LinkTarget has an interwiki component + * @since 1.27 + * + * @return bool + */ + public function isExternal(); + + /** + * The interwiki component of this LinkTarget + * @since 1.27 + * + * @return string + */ + public function getInterwiki(); }