MediaWiki REL1_35
ApiHelpParamValueMessage.php
Go to the documentation of this file.
1<?php
35
36 protected $paramValue;
37 protected $deprecated;
38 protected $internal;
39
53 public function __construct(
55 $text,
56 $params = [],
57 $deprecated = false,
58 $internal = false
59 ) {
60 parent::__construct( $text, $params );
61 $this->paramValue = $paramValue;
62 $this->deprecated = (bool)$deprecated;
63 $this->internal = (bool)$internal;
64 }
65
70 public function getParamValue() {
71 return $this->paramValue;
72 }
73
79 public function isDeprecated() {
80 return $this->deprecated;
81 }
82
88 public function isInternal() {
89 return $this->internal;
90 }
91
96 public function fetchMessage() {
97 if ( $this->message === null ) {
98 $prefix = '';
99 if ( $this->isDeprecated() ) {
100 $prefix .= '<span class="apihelp-deprecated">' .
101 $this->subMessage( 'api-help-param-deprecated' ) .
102 '</span>' .
103 $this->subMessage( 'word-separator' );
104 }
105 if ( $this->isInternal() ) {
106 $prefix .= '<span class="apihelp-internal">' .
107 $this->subMessage( 'api-help-param-internal' ) .
108 '</span>' .
109 $this->subMessage( 'word-separator' );
110 }
111 $this->message = ";<span dir=\"ltr\" lang=\"en\">{$this->paramValue}</span>:"
112 . $prefix . parent::fetchMessage();
113 }
114 return $this->message;
115 }
116
117 private function subMessage( $key ) {
118 $msg = new Message( $key );
119 $msg->interface = $this->interface;
120 $msg->language = $this->language;
121 $msg->useDatabase = $this->useDatabase;
122 $msg->title = $this->title;
123 return $msg->fetchMessage();
124 }
125
126}
Message subclass that prepends wikitext for API help.
isInternal()
Fetch the 'internal' flag.
__construct( $paramValue, $text, $params=[], $deprecated=false, $internal=false)
getParamValue()
Fetch the parameter value.
isDeprecated()
Fetch the 'deprecated' flag.
The Message class deals with fetching and processing of interface message into a variety of formats.
Definition Message.php:161
bool $useDatabase
Whether database can be used.
Definition Message.php:224
string $key
The message key.
Definition Message.php:203
Language bool $language
In which language to get this message.
Definition Message.php:197
string $message
Definition Message.php:239
Title $title
Title object to use as context.
Definition Message.php:229
bool $interface
In which language to get this message.
Definition Message.php:190