MediaWiki REL1_31
ApiHelpParamValueMessage.php
Go to the documentation of this file.
1<?php
33
34 protected $paramValue;
35 protected $deprecated;
36
47 public function __construct( $paramValue, $text, $params = [], $deprecated = false ) {
48 parent::__construct( $text, $params );
49 $this->paramValue = $paramValue;
50 $this->deprecated = (bool)$deprecated;
51 }
52
57 public function getParamValue() {
58 return $this->paramValue;
59 }
60
66 public function isDeprecated() {
67 return $this->deprecated;
68 }
69
74 public function fetchMessage() {
75 if ( $this->message === null ) {
76 $dep = '';
77 if ( $this->isDeprecated() ) {
78 $msg = new Message( 'api-help-param-deprecated' );
79 $msg->interface = $this->interface;
80 $msg->language = $this->language;
81 $msg->useDatabase = $this->useDatabase;
82 $msg->title = $this->title;
83 $dep = '<span class="apihelp-deprecated">' . $msg->fetchMessage() . '</span> ';
84 }
85 $this->message = ";<span dir=\"ltr\" lang=\"en\">{$this->paramValue}</span>:"
86 . $dep . parent::fetchMessage();
87 }
88 return $this->message;
89 }
90
91}
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