29 parent::__construct( $query, $moduleName,
'rf' );
41 $config = MediaWikiServices::getInstance()->getConfigFactory()->makeConfig(
'cite' );
42 if ( !$config->get(
'CiteStoreReferencesData' ) ) {
46 $titles = $this->
getPageSet()->getGoodTitles();
48 if ( !is_null( $params[
'continue'] ) ) {
49 $startId = (int)$params[
'continue'];
56 foreach ( $titles as $pageId =>
$title ) {
58 if ( $startId !==
false && $startId !== $pageId ) {
66 if ( $storedRefs !==
false ) {
68 foreach ( $storedRefs[
'refs'] as $index => $grouping ) {
69 foreach ( $grouping as $group => $members ) {
70 foreach ( $members as $name => $ref ) {
73 if ( is_string( $name ) ) {
78 $ref[
'group'] = $group;
79 $ref[
'reflist'] = $index;
80 $allReferences[$id] = $ref;
86 ApiResult::setArrayType( $allReferences,
'kvp',
'id' );
112 'action=query&prop=references&titles=Albert%20Einstein' =>
113 'apihelp-query+references-example-1',
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
dieContinueUsageIf( $condition)
Die with the 'badcontinue' error.
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
This is a base class for all Query modules.
setContinueEnumParameter( $paramName, $paramValue)
Set a query-continue value.
addPageSubItems( $pageId, $data)
Add a sub-element under the page element with the given page ID.
getPageSet()
Get the PageSet object to work on.
__construct( $query, $moduleName)
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
getCacheMode( $params)
Get the cache mode for the data generated by this module.
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
static getStoredReferences(Title $title)
Fetch references stored for the given title in page_props For performance, results are cached.
static getReferencesKey( $key)
Return an id for use in wikitext output based on a key and optionally the number of it,...