MediaWiki master
ApiHelpParamValueMessage.php
Go to the documentation of this file.
1<?php
24
37
38 protected $paramValue;
39 protected $deprecated;
40 protected $internal;
41
55 public function __construct(
57 $text,
58 $params = [],
59 $deprecated = false,
60 $internal = false
61 ) {
62 parent::__construct( $text, $params );
63 $this->paramValue = $paramValue;
64 $this->deprecated = (bool)$deprecated;
65 $this->internal = (bool)$internal;
66 }
67
72 public function getParamValue() {
73 return $this->paramValue;
74 }
75
81 public function isDeprecated() {
82 return $this->deprecated;
83 }
84
90 public function isInternal() {
91 return $this->internal;
92 }
93
97 public function fetchMessage() {
98 if ( $this->message === null ) {
99 $prefix = '';
100 if ( $this->isDeprecated() ) {
101 $prefix .= '<span class="apihelp-deprecated">' .
102 $this->subMessage( 'api-help-param-deprecated' ) .
103 '</span>' .
104 $this->subMessage( 'word-separator' );
105 }
106 if ( $this->isInternal() ) {
107 $prefix .= '<span class="apihelp-internal">' .
108 $this->subMessage( 'api-help-param-internal' ) .
109 '</span>' .
110 $this->subMessage( 'word-separator' );
111 }
112 $this->message = ";<span dir=\"ltr\" lang=\"en\">{$this->paramValue}</span>:"
113 . $prefix . parent::fetchMessage();
114 }
115 return $this->message;
116 }
117
118 private function subMessage( $key ) {
119 $msg = new Message( $key );
120 $msg->isInterface = $this->isInterface;
121 $msg->language = $this->language;
122 $msg->useDatabase = $this->useDatabase;
123 $msg->contextPage = $this->contextPage;
124 return $msg->fetchMessage();
125 }
126
127}
array $params
The job parameters.
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:158
string $key
The message key.
Definition Message.php:206
PageReference $contextPage
page object to use as context.
Definition Message.php:234
bool $useDatabase
If messages in the local MediaWiki namespace should be loaded; false to use only the compiled Localis...
Definition Message.php:229
Language Language null $language
In which language to get this message.
Definition Message.php:194
bool $isInterface
In which language to get this message.
Definition Message.php:187
string null false $message
Definition Message.php:244