33 parent::__construct( $query, $moduleName,
'pp' );
37 # Only operate on existing pages
41 if ( $this->params[
'continue'] ) {
42 $continueValue = (int)$this->params[
'continue'];
45 foreach ( $pages as $id => $page ) {
46 if ( $id >= $continueValue ) {
47 $filteredPages[$id] = $page;
50 $pages = $filteredPages;
53 if ( $pages === [] ) {
60 if ( $this->params[
'prop'] ) {
61 $propnames = $this->params[
'prop'];
62 $properties = $pageProps->getProperties( $pages, $propnames );
64 $properties = $pageProps->getAllProperties( $pages );
69 foreach ( $properties as $page => $props ) {
87 $fit = $result->addValue( [
'query',
'pages', $page ],
'pageprops', $props );
113 'action=query&prop=pageprops&titles=Main%20Page|MediaWiki'
114 =>
'apihelp-query+pageprops-example-simple',
119 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Pageprops';
dieContinueUsageIf( $condition)
Die with the 'badcontinue' error.
getResult()
Get the result object.
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.
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
This is a base class for all Query modules.
setContinueEnumParameter( $paramName, $paramValue)
Set a query-continue value.
getPageSet()
Get the PageSet object to work on.
A query module to show basic page information.
getHelpUrls()
Return links to more detailed help pages about the module.
__construct(ApiQuery $query, $moduleName)
getExamplesMessages()
Returns usage examples for this module.
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
addPageProps( $result, $page, $props)
Add page properties to an ApiResult, adding a continue parameter if it doesn't fit.
getCacheMode( $params)
Get the cache mode for the data generated by this module.
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
This is the main query class.
static setArrayType(array &$arr, $type, $kvpKeyName=null)
Set the array data type.