MediaWiki
REL1_35
MalformedTitleException.php
Go to the documentation of this file.
1
<?php
26
class
MalformedTitleException
extends
Exception implements
ILocalizedException
{
27
private
$titleText
=
null
;
28
private
$errorMessage
=
null
;
29
private
$errorMessageParameters
= [];
30
38
public
function
__construct
(
39
$errorMessage, $titleText =
null
, $errorMessageParameters = []
40
) {
41
$this->errorMessage =
$errorMessage
;
42
$this->titleText =
$titleText
;
43
if
(
$titleText
!==
null
) {
44
$errorMessageParameters
[] =
wfEscapeWikiText
(
$titleText
);
45
}
46
$this->errorMessageParameters =
$errorMessageParameters
;
47
48
// Supply something useful for Exception::getMessage() to return.
49
$enMsg =
wfMessage
(
$errorMessage
,
$errorMessageParameters
);
50
$enMsg->inLanguage(
'en'
)->useDatabase(
false
);
51
parent::__construct( $enMsg->text() );
52
}
53
58
public
function
getTitleText
() {
59
return
$this->titleText;
60
}
61
66
public
function
getErrorMessage
() {
67
return
$this->errorMessage;
68
}
69
74
public
function
getErrorMessageParameters
() {
75
return
$this->errorMessageParameters;
76
}
77
82
public
function
getMessageObject
() {
83
return
wfMessage
( $this->
getErrorMessage
(), $this->
getErrorMessageParameters
() );
84
}
85
}
wfMessage
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Definition
GlobalFunctions.php:1220
wfEscapeWikiText
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
Definition
GlobalFunctions.php:1488
MalformedTitleException
MalformedTitleException is thrown when a TitleParser is unable to parse a title string.
Definition
MalformedTitleException.php:26
MalformedTitleException\$titleText
$titleText
Definition
MalformedTitleException.php:27
MalformedTitleException\getTitleText
getTitleText()
Definition
MalformedTitleException.php:58
MalformedTitleException\$errorMessageParameters
$errorMessageParameters
Definition
MalformedTitleException.php:29
MalformedTitleException\getMessageObject
getMessageObject()
Definition
MalformedTitleException.php:82
MalformedTitleException\__construct
__construct( $errorMessage, $titleText=null, $errorMessageParameters=[])
Stable to call.
Definition
MalformedTitleException.php:38
MalformedTitleException\getErrorMessage
getErrorMessage()
Definition
MalformedTitleException.php:66
MalformedTitleException\getErrorMessageParameters
getErrorMessageParameters()
Definition
MalformedTitleException.php:74
MalformedTitleException\$errorMessage
$errorMessage
Definition
MalformedTitleException.php:28
ILocalizedException
Interface for MediaWiki-localized exceptions.
Definition
ILocalizedException.php:29
includes
title
MalformedTitleException.php
Generated on Sat Apr 6 2024 00:08:03 for MediaWiki by
1.9.8