MediaWiki fundraising/REL1_35
MalformedTitleException.php
Go to the documentation of this file.
1<?php
26class MalformedTitleException extends Exception implements ILocalizedException {
27 private $titleText = null;
28 private $errorMessage = null;
30
38 public function __construct(
39 $errorMessage, $titleText = null, $errorMessageParameters = []
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() {
75 return $this->errorMessageParameters;
76 }
77
82 public function getMessageObject() {
83 return wfMessage( $this->getErrorMessage(), $this->getErrorMessageParameters() );
84 }
85}
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
MalformedTitleException is thrown when a TitleParser is unable to parse a title string.
__construct( $errorMessage, $titleText=null, $errorMessageParameters=[])
Stable to call.
Interface for MediaWiki-localized exceptions.