47 parent::__construct( $query, $moduleName,
'pp' );
48 $this->pageProps = $pageProps;
52 # Only operate on existing pages
56 if ( $params[
'continue'] ) {
58 $continueValue = $cont[0];
60 foreach ( $pages as $id => $page ) {
61 if ( $id >= $continueValue ) {
62 $filteredPages[$id] = $page;
65 $pages = $filteredPages;
68 if ( $pages === [] ) {
73 if ( $params[
'prop'] ) {
74 $properties = $this->pageProps->getProperties( $pages, $params[
'prop'] );
76 $properties = $this->pageProps->getAllProperties( $pages );
82 foreach ( $properties as $pageid => $props ) {
83 if ( !$this->addPageProps( $result, $pageid, $props ) ) {
98 private function addPageProps( $result, $page, $props ) {
99 ApiResult::setArrayType( $props,
'assoc' );
100 $fit = $result->addValue( [
'query',
'pages', $page ],
'pageprops', $props );
119 ParamValidator::PARAM_ISMULTI =>
true,
125 $title = Title::newMainPage()->getPrefixedText();
126 $mp = rawurlencode(
$title );
129 "action=query&prop=pageprops&titles={$mp}|MediaWiki"
130 =>
'apihelp-query+pageprops-example-simple',
135 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Pageprops';
parseContinueParamOrDie(string $continue, array $types)
Parse the 'continue' parameter in the usual format and validate the types of each part,...
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.
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.
__construct(ApiQuery $query, $moduleName, PageProps $pageProps)
getHelpUrls()
Return links to more detailed help pages about the module.
getExamplesMessages()
Returns usage examples for this module.
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
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.
Gives access to properties of a page.