MediaWiki master
MediaWiki\Api\ApiContinuationManager Class Reference

This manages continuation state. More...

Public Member Functions

 __construct (ApiBase $module, array $allModules=[], array $generatedModules=[])
 
 addContinueParam (ApiBase $module, $paramName, $paramValue)
 Set the continuation parameter for a module.
 
 addGeneratorContinueParam (ApiBase $module, $paramName, $paramValue)
 Set the continuation parameter for the generator module.
 
 addGeneratorNonContinueParam (ApiBase $module, $paramName, $paramValue)
 Set the non-continuation parameter for the generator module.
 
 getContinuation ()
 Fetch continuation result data.
 
 getRawContinuation ()
 Fetch raw continuation data.
 
 getRawNonContinuation ()
 Fetch raw non-continuation data.
 
 getRunModules ()
 Get the list of modules that should actually be run.
 
 getSource ()
 Get the class that created this manager.
 
 isGeneratorDone ()
 
 setContinuationIntoResult (ApiResult $result)
 Store the continuation data into the result.
 

Detailed Description

This manages continuation state.

Since
1.25 this is no longer a subclass of ApiBase

Definition at line 30 of file ApiContinuationManager.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Api\ApiContinuationManager::__construct ( ApiBase $module,
array $allModules = [],
array $generatedModules = [] )
Parameters
ApiBase$moduleModule starting the continuation
ApiBase[]$allModulesContains ApiBase instances that will be executed
string[]$generatedModulesNames of modules that depend on the generator
Exceptions
ApiUsageException

Definition at line 57 of file ApiContinuationManager.php.

References $params, MediaWiki\Api\ApiBase\extractRequestParams(), MediaWiki\Api\ApiBase\getMain(), MediaWiki\Api\ApiBase\getModuleName(), MediaWiki\Context\ContextSource\getRequest(), and MediaWiki\Api\ApiUsageException\newWithMessage().

Member Function Documentation

◆ addContinueParam()

MediaWiki\Api\ApiContinuationManager::addContinueParam ( ApiBase $module,
$paramName,
$paramValue )

Set the continuation parameter for a module.

Parameters
ApiBase$module
string$paramName
string | array$paramValue
Exceptions
UnexpectedValueException

Definition at line 131 of file ApiContinuationManager.php.

References MediaWiki\Api\ApiBase\encodeParamName(), and MediaWiki\Api\ApiBase\getModuleName().

◆ addGeneratorContinueParam()

MediaWiki\Api\ApiContinuationManager::addGeneratorContinueParam ( ApiBase $module,
$paramName,
$paramValue )

Set the continuation parameter for the generator module.

Parameters
ApiBase$module
string$paramName
int | string | array$paramValue

Definition at line 178 of file ApiContinuationManager.php.

References MediaWiki\Api\ApiBase\encodeParamName(), and MediaWiki\Api\ApiBase\getModuleName().

◆ addGeneratorNonContinueParam()

MediaWiki\Api\ApiContinuationManager::addGeneratorNonContinueParam ( ApiBase $module,
$paramName,
$paramValue )

Set the non-continuation parameter for the generator module.

In case the generator isn't going to be continued, this sets the fields to return.

Since
1.28
Parameters
ApiBase$module
string$paramName
string | array$paramValue

Definition at line 163 of file ApiContinuationManager.php.

References MediaWiki\Api\ApiBase\encodeParamName(), and MediaWiki\Api\ApiBase\getModuleName().

◆ getContinuation()

MediaWiki\Api\ApiContinuationManager::getContinuation ( )

Fetch continuation result data.

Returns
array [ (array)$data, (bool)$batchcomplete ]

Definition at line 208 of file ApiContinuationManager.php.

Referenced by MediaWiki\Api\ApiContinuationManager\setContinuationIntoResult().

◆ getRawContinuation()

MediaWiki\Api\ApiContinuationManager::getRawContinuation ( )

Fetch raw continuation data.

Returns
array[]

Definition at line 191 of file ApiContinuationManager.php.

◆ getRawNonContinuation()

MediaWiki\Api\ApiContinuationManager::getRawNonContinuation ( )

Fetch raw non-continuation data.

Since
1.28
Returns
array[]

Definition at line 200 of file ApiContinuationManager.php.

◆ getRunModules()

MediaWiki\Api\ApiContinuationManager::getRunModules ( )

Get the list of modules that should actually be run.

Returns
ApiBase[]

Definition at line 120 of file ApiContinuationManager.php.

◆ getSource()

MediaWiki\Api\ApiContinuationManager::getSource ( )

Get the class that created this manager.

Returns
string

Definition at line 105 of file ApiContinuationManager.php.

◆ isGeneratorDone()

MediaWiki\Api\ApiContinuationManager::isGeneratorDone ( )
Returns
bool

Definition at line 112 of file ApiContinuationManager.php.

◆ setContinuationIntoResult()

MediaWiki\Api\ApiContinuationManager::setContinuationIntoResult ( ApiResult $result)

Store the continuation data into the result.

Parameters
ApiResult$result

Definition at line 270 of file ApiContinuationManager.php.

References MediaWiki\Api\ApiResult\ADD_ON_TOP, MediaWiki\Api\ApiResult\addValue(), MediaWiki\Api\ApiContinuationManager\getContinuation(), and MediaWiki\Api\ApiResult\NO_SIZE_CHECK.


The documentation for this class was generated from the following file: