MediaWiki
1.42.1
ApiQueryGeneratorBase.php
Go to the documentation of this file.
1
<?php
28
abstract
class
ApiQueryGeneratorBase
extends
ApiQueryBase
{
29
30
private
$mGeneratorPageSet =
null
;
31
39
public
function
setGeneratorMode
(
ApiPageSet
$generatorPageSet ) {
40
$this->mGeneratorPageSet = $generatorPageSet;
41
}
42
48
public
function
isInGeneratorMode
() {
49
return
$this->mGeneratorPageSet !==
null
;
50
}
51
57
protected
function
getPageSet
() {
58
return
$this->mGeneratorPageSet ?? parent::getPageSet();
59
}
60
66
public
function
encodeParamName
( $paramName ) {
67
if
( $this->mGeneratorPageSet !==
null
) {
68
return
'g'
. parent::encodeParamName( $paramName );
69
}
else
{
70
return
parent::encodeParamName( $paramName );
71
}
72
}
73
79
protected
function
setContinueEnumParameter
( $paramName, $paramValue ) {
80
if
( $this->mGeneratorPageSet !==
null
) {
81
$this->
getContinuationManager
()->addGeneratorContinueParam( $this, $paramName, $paramValue );
82
}
else
{
83
parent::setContinueEnumParameter( $paramName, $paramValue );
84
}
85
}
86
88
protected
function
getHelpFlags
() {
89
// Corresponding messages: api-help-flag-generator
90
$flags = parent::getHelpFlags();
91
$flags[] =
'generator'
;
92
return
$flags;
93
}
94
99
abstract
public
function
executeGenerator
( $resultPageSet );
100
}
ApiBase\getContinuationManager
getContinuationManager()
Definition
ApiBase.php:708
ApiPageSet
This class contains a list of pages that the client has requested.
Definition
ApiPageSet.php:58
ApiQueryBase
This is a base class for all Query modules.
Definition
ApiQueryBase.php:42
ApiQueryGeneratorBase
Definition
ApiQueryGeneratorBase.php:28
ApiQueryGeneratorBase\setContinueEnumParameter
setContinueEnumParameter( $paramName, $paramValue)
Overridden to set the generator param if in generator mode.
Definition
ApiQueryGeneratorBase.php:79
ApiQueryGeneratorBase\getPageSet
getPageSet()
Get the PageSet object to work on.
Definition
ApiQueryGeneratorBase.php:57
ApiQueryGeneratorBase\setGeneratorMode
setGeneratorMode(ApiPageSet $generatorPageSet)
Switch this module to generator mode.
Definition
ApiQueryGeneratorBase.php:39
ApiQueryGeneratorBase\executeGenerator
executeGenerator( $resultPageSet)
Execute this module as a generator.
ApiQueryGeneratorBase\getHelpFlags
getHelpFlags()
Generates the list of flags for the help screen and for action=paraminfo.Corresponding messages: api-...
Definition
ApiQueryGeneratorBase.php:88
ApiQueryGeneratorBase\encodeParamName
encodeParamName( $paramName)
Overrides ApiBase to prepend 'g' to every generator parameter.
Definition
ApiQueryGeneratorBase.php:66
ApiQueryGeneratorBase\isInGeneratorMode
isInGeneratorMode()
Indicate whether the module is in generator mode.
Definition
ApiQueryGeneratorBase.php:48
includes
api
ApiQueryGeneratorBase.php
Generated on Thu Jun 27 2024 15:58:18 for MediaWiki by
1.10.0