46 parent::__construct( $query, $moduleName,
'pp' );
47 $this->pageProps = $pageProps;
51 # Only operate on existing pages
55 if ( $params[
'continue'] ) {
57 $continueValue = $cont[0];
59 foreach ( $pages as $id => $page ) {
60 if ( $id >= $continueValue ) {
61 $filteredPages[$id] = $page;
64 $pages = $filteredPages;
67 if ( $pages === [] ) {
72 if ( $params[
'prop'] ) {
73 $properties = $this->pageProps->getProperties( $pages, $params[
'prop'] );
75 $properties = $this->pageProps->getAllProperties( $pages );
81 foreach ( $properties as $pageid => $props ) {
82 if ( !$this->addPageProps( $result, $pageid, $props ) ) {
97 private function addPageProps( $result, $page, $props ) {
98 ApiResult::setArrayType( $props,
'assoc' );
99 $fit = $result->addValue( [
'query',
'pages', $page ],
'pageprops', $props );
118 ParamValidator::PARAM_ISMULTI =>
true,
124 $title = Title::newMainPage()->getPrefixedText();
125 $mp = rawurlencode( $title );
128 "action=query&prop=pageprops&titles={$mp}|MediaWiki"
129 =>
'apihelp-query+pageprops-example-simple',
134 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.