* @license GPL 2+
* @author Daniel Kinzler
*/
+use MediaWiki\Linker\LinkTarget;
use Wikimedia\Assert\Assert;
/**
return $this->fragment;
}
+ /**
+ * @since 1.27
+ * @return bool
+ */
+ public function hasFragment() {
+ return $this->fragment !== '';
+ }
+
/**
* Returns the title's DB key, as supplied to the constructor,
* without namespace prefix or fragment.
/**
* Creates a new TitleValue for a different fragment of the same page.
*
+ * @since 1.27
* @param string $fragment The fragment name, or "" for the entire page.
*
* @return TitleValue
*/
- public function createFragmentTitle( $fragment ) {
+ public function createFragmentTarget( $fragment ) {
return new TitleValue( $this->namespace, $this->dbkey, $fragment );
}