MediaWiki  master
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;
30 
38  public function __construct(
40  ) {
41  $this->errorMessage = $errorMessage;
42  $this->titleText = $titleText;
43  if ( $titleText !== null ) {
45  }
46  $this->errorMessageParameters = $errorMessageParameters;
47 
48  // Supply something useful for Exception::getMessage() to return.
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() {
76  }
77 
82  public function getMessageObject() {
83  return wfMessage( $this->getErrorMessage(), $this->getErrorMessageParameters() );
84  }
85 }
MalformedTitleException\getErrorMessage
getErrorMessage()
Definition: MalformedTitleException.php:66
MalformedTitleException\$errorMessage
$errorMessage
Definition: MalformedTitleException.php:28
MalformedTitleException\getMessageObject
getMessageObject()
Definition: MalformedTitleException.php:82
MalformedTitleException\$titleText
$titleText
Definition: MalformedTitleException.php:27
wfMessage
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Definition: GlobalFunctions.php:1220
MalformedTitleException\$errorMessageParameters
$errorMessageParameters
Definition: MalformedTitleException.php:29
MalformedTitleException\__construct
__construct( $errorMessage, $titleText=null, $errorMessageParameters=[])
Stable to call.
Definition: MalformedTitleException.php:38
ILocalizedException
Interface for MediaWiki-localized exceptions.
Definition: ILocalizedException.php:29
MalformedTitleException\getErrorMessageParameters
getErrorMessageParameters()
Definition: MalformedTitleException.php:74
MalformedTitleException
MalformedTitleException is thrown when a TitleParser is unable to parse a title string.
Definition: MalformedTitleException.php:26
MalformedTitleException\getTitleText
getTitleText()
Definition: MalformedTitleException.php:58