MediaWiki REL1_34
ApiHelpParamValueMessage.php
Go to the documentation of this file.
1<?php
34
35 protected $paramValue;
36 protected $deprecated;
37
48 public function __construct( $paramValue, $text, $params = [], $deprecated = false ) {
49 parent::__construct( $text, $params );
50 $this->paramValue = $paramValue;
51 $this->deprecated = (bool)$deprecated;
52 }
53
58 public function getParamValue() {
59 return $this->paramValue;
60 }
61
67 public function isDeprecated() {
68 return $this->deprecated;
69 }
70
75 public function fetchMessage() {
76 if ( $this->message === null ) {
77 $dep = '';
78 if ( $this->isDeprecated() ) {
79 $msg = new Message( 'api-help-param-deprecated' );
80 $msg->interface = $this->interface;
81 $msg->language = $this->language;
82 $msg->useDatabase = $this->useDatabase;
83 $msg->title = $this->title;
84 $dep = '<span class="apihelp-deprecated">' . $msg->fetchMessage() . '</span> ';
85 }
86 $this->message = ";<span dir=\"ltr\" lang=\"en\">{$this->paramValue}</span>:"
87 . $dep . parent::fetchMessage();
88 }
89 return $this->message;
90 }
91
92}
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:162
bool $useDatabase
Whether database can be used.
Definition Message.php:225
Language bool $language
In which language to get this message.
Definition Message.php:198
string $message
Definition Message.php:240
Title $title
Title object to use as context.
Definition Message.php:230
bool $interface
In which language to get this message.
Definition Message.php:191