MediaWiki REL1_37
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
95 public function fetchMessage() {
96 if ( $this->message === null ) {
97 $prefix = '';
98 if ( $this->isDeprecated() ) {
99 $prefix .= '<span class="apihelp-deprecated">' .
100 $this->subMessage( 'api-help-param-deprecated' ) .
101 '</span>' .
102 $this->subMessage( 'word-separator' );
103 }
104 if ( $this->isInternal() ) {
105 $prefix .= '<span class="apihelp-internal">' .
106 $this->subMessage( 'api-help-param-internal' ) .
107 '</span>' .
108 $this->subMessage( 'word-separator' );
109 }
110 $this->message = ";<span dir=\"ltr\" lang=\"en\">{$this->paramValue}</span>:"
111 . $prefix . parent::fetchMessage();
112 }
113 return $this->message;
114 }
115
116 private function subMessage( $key ) {
117 $msg = new Message( $key );
118 $msg->interface = $this->interface;
119 $msg->language = $this->language;
120 $msg->useDatabase = $this->useDatabase;
121 $msg->contextPage = $this->contextPage;
122 return $msg->fetchMessage();
123 }
124
125}
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:138
bool $useDatabase
Whether database can be used.
Definition Message.php:195
string $key
The message key.
Definition Message.php:180
PageReference $contextPage
page object to use as context.
Definition Message.php:200
Language bool $language
In which language to get this message.
Definition Message.php:174
string $message
Definition Message.php:210
bool $interface
In which language to get this message.
Definition Message.php:167