MediaWiki  master
ApiHelpParamValueMessage.php
Go to the documentation of this file.
1 <?php
34 
35  protected $paramValue;
36  protected $deprecated;
37  protected $internal;
38 
51  public function __construct(
53  $text,
54  $params = [],
55  $deprecated = false,
56  $internal = false
57  ) {
58  parent::__construct( $text, $params );
59  $this->paramValue = $paramValue;
60  $this->deprecated = (bool)$deprecated;
61  $this->internal = (bool)$internal;
62  }
63 
68  public function getParamValue() {
69  return $this->paramValue;
70  }
71 
77  public function isDeprecated() {
78  return $this->deprecated;
79  }
80 
86  public function isInternal() {
87  return $this->internal;
88  }
89 
94  public function fetchMessage() {
95  if ( $this->message === null ) {
96  $prefix = '';
97  if ( $this->isDeprecated() ) {
98  $prefix .= '<span class="apihelp-deprecated">' .
99  $this->subMessage( 'api-help-param-deprecated' ) .
100  '</span>' .
101  $this->subMessage( 'word-separator' );
102  }
103  if ( $this->isInternal() ) {
104  $prefix .= '<span class="apihelp-internal">' .
105  $this->subMessage( 'api-help-param-internal' ) .
106  '</span>' .
107  $this->subMessage( 'word-separator' );
108  }
109  $this->message = ";<span dir=\"ltr\" lang=\"en\">{$this->paramValue}</span>:"
110  . $prefix . parent::fetchMessage();
111  }
112  return $this->message;
113  }
114 
115  private function subMessage( $key ) {
116  $msg = new Message( $key );
117  $msg->interface = $this->interface;
118  $msg->language = $this->language;
119  $msg->useDatabase = $this->useDatabase;
120  $msg->title = $this->title;
121  return $msg->fetchMessage();
122  }
123 
124 }
ApiHelpParamValueMessage\$internal
$internal
Definition: ApiHelpParamValueMessage.php:37
ApiHelpParamValueMessage\getParamValue
getParamValue()
Fetch the parameter value.
Definition: ApiHelpParamValueMessage.php:68
Message
ApiHelpParamValueMessage\isInternal
isInternal()
Fetch the 'internal' flag.
Definition: ApiHelpParamValueMessage.php:86
ApiHelpParamValueMessage\fetchMessage
fetchMessage()
Fetch the message.
Definition: ApiHelpParamValueMessage.php:94
ApiHelpParamValueMessage\subMessage
subMessage( $key)
Definition: ApiHelpParamValueMessage.php:115
$title
$title
Definition: testCompression.php:36
ApiHelpParamValueMessage\$paramValue
$paramValue
Definition: ApiHelpParamValueMessage.php:35
ApiHelpParamValueMessage\__construct
__construct( $paramValue, $text, $params=[], $deprecated=false, $internal=false)
Definition: ApiHelpParamValueMessage.php:51
ApiHelpParamValueMessage\isDeprecated
isDeprecated()
Fetch the 'deprecated' flag.
Definition: ApiHelpParamValueMessage.php:77
ApiHelpParamValueMessage\$deprecated
$deprecated
Definition: ApiHelpParamValueMessage.php:36
ApiHelpParamValueMessage
Message subclass that prepends wikitext for API help.
Definition: ApiHelpParamValueMessage.php:33