MediaWiki  master
MalformedTitleException.php
Go to the documentation of this file.
1 <?php
26 class MalformedTitleException extends Exception implements ILocalizedException {
27 
29  private $titleText;
31  private $errorMessage;
34 
42  public function __construct(
44  ) {
45  $this->errorMessage = $errorMessage;
46  $this->titleText = $titleText;
47  if ( $titleText !== null ) {
49  }
50  $this->errorMessageParameters = $errorMessageParameters;
51 
52  // Supply something useful for Exception::getMessage() to return.
54  $enMsg->inLanguage( 'en' )->useDatabase( false );
55  parent::__construct( $enMsg->text() );
56  }
57 
62  public function getTitleText() {
63  return $this->titleText;
64  }
65 
70  public function getErrorMessage() {
71  return $this->errorMessage;
72  }
73 
78  public function getErrorMessageParameters() {
80  }
81 
86  public function getMessageObject() {
87  return wfMessage( $this->getErrorMessage(), $this->getErrorMessageParameters() );
88  }
89 }
MalformedTitleException\getErrorMessage
getErrorMessage()
Definition: MalformedTitleException.php:70
MalformedTitleException\getMessageObject
getMessageObject()
Definition: MalformedTitleException.php:86
wfMessage
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Definition: GlobalFunctions.php:1183
MalformedTitleException\__construct
__construct( $errorMessage, $titleText=null, $errorMessageParameters=[])
Definition: MalformedTitleException.php:42
MalformedTitleException\$titleText
string null $titleText
Definition: MalformedTitleException.php:29
MalformedTitleException\$errorMessage
string $errorMessage
Definition: MalformedTitleException.php:31
ILocalizedException
Interface for MediaWiki-localized exceptions.
Definition: ILocalizedException.php:29
MalformedTitleException\$errorMessageParameters
array $errorMessageParameters
Definition: MalformedTitleException.php:33
MalformedTitleException\getErrorMessageParameters
getErrorMessageParameters()
Definition: MalformedTitleException.php:78
wfEscapeWikiText
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
Definition: GlobalFunctions.php:1456
MalformedTitleException
MalformedTitleException is thrown when a TitleParser is unable to parse a title string.
Definition: MalformedTitleException.php:26
MalformedTitleException\getTitleText
getTitleText()
Definition: MalformedTitleException.php:62