MediaWiki REL1_30
ApiHelpParamValueMessage.php
Go to the documentation of this file.
1<?php
37
38 protected $paramValue;
39 protected $deprecated;
40
51 public function __construct( $paramValue, $text, $params = [], $deprecated = false ) {
52 parent::__construct( $text, $params );
53 $this->paramValue = $paramValue;
54 $this->deprecated = (bool)$deprecated;
55 }
56
61 public function getParamValue() {
62 return $this->paramValue;
63 }
64
70 public function isDeprecated() {
71 return $this->deprecated;
72 }
73
78 public function fetchMessage() {
79 if ( $this->message === null ) {
80 $dep = '';
81 if ( $this->isDeprecated() ) {
82 $msg = new Message( 'api-help-param-deprecated' );
83 $msg->interface = $this->interface;
84 $msg->language = $this->language;
85 $msg->useDatabase = $this->useDatabase;
86 $msg->title = $this->title;
87 $dep = '<span class="apihelp-deprecated">' . $msg->fetchMessage() . '</span> ';
88 }
89 $this->message = ";<span dir=\"ltr\" lang=\"en\">{$this->paramValue}</span>:"
90 . $dep . parent::fetchMessage();
91 }
92 return $this->message;
93 }
94
95}
Message subclass that prepends wikitext for API help.
__construct( $paramValue, $text, $params=[], $deprecated=false)
getParamValue()
Fetch the parameter value.
isDeprecated()
Fetch the 'deprecated' flag.
The Message class provides methods which fulfil two basic services:
Definition Message.php:159
bool $useDatabase
Whether database can be used.
Definition Message.php:222
Language bool $language
In which language to get this message.
Definition Message.php:195
string $message
Definition Message.php:237
Title $title
Title object to use as context.
Definition Message.php:227
bool $interface
In which language to get this message.
Definition Message.php:188
$params