Go to the documentation of this file.
32 parent::__construct( $query, $moduleName,
'ci' );
37 $alltitles = $this->
getPageSet()->getGoodAndMissingTitlesByNamespace();
43 $titles = $this->
getPageSet()->getGoodAndMissingTitles();
45 foreach ( $categories as $c ) {
48 $cattitles[$c] =
$t->getDBkey();
51 $this->
addTables( [
'category',
'page',
'page_props' ] );
53 'page' => [
'LEFT JOIN', [
54 'page_namespace' => NS_CATEGORY,
55 'page_title=cat_title' ] ],
56 'page_props' => [
'LEFT JOIN', [
58 'pp_propname' =>
'hiddencat' ] ],
66 'cat_hidden' =>
'pp_propname'
68 $this->
addWhere( [
'cat_title' => $cattitles ] );
70 if ( !is_null( $params[
'continue'] ) ) {
71 $title = $this->
getDB()->addQuotes( $params[
'continue'] );
72 $this->
addWhere(
"cat_title >= $title" );
74 $this->
addOption(
'ORDER BY',
'cat_title' );
78 $catids = array_flip( $cattitles );
79 foreach (
$res as $row ) {
81 $vals[
'size'] = (int)$row->cat_pages;
82 $vals[
'pages'] = $row->cat_pages - $row->cat_subcats - $row->cat_files;
83 $vals[
'files'] = (
int)$row->cat_files;
84 $vals[
'subcats'] = (int)$row->cat_subcats;
85 $vals[
'hidden'] = (
bool)$row->cat_hidden;
108 'action=query&prop=categoryinfo&titles=Category:Foo|Category:Bar'
109 =>
'apihelp-query+categoryinfo-example-simple',
114 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Categoryinfo';
addPageSubItems( $pageId, $data)
Add a sub-element under the page element with the given page ID.
addFields( $value)
Add a set of fields to select to the internal array.
This is the main query class.
This query adds the "<categories>" subelement to all pages with the list of categories the page is in...
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
getHelpUrls()
Return links to more detailed help pages about the module.
getCacheMode( $params)
Get the cache mode for the data generated by this module.
addOption( $name, $value=null)
Add an option such as LIMIT or USE INDEX.
This is a base class for all Query modules.
getDB()
Get the Query database connection (read-only)
addTables( $tables, $alias=null)
Add a set of tables to the internal array.
select( $method, $extraQuery=[], array &$hookData=null)
Execute a SELECT query based on the values in the internal arrays.
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
addJoinConds( $join_conds)
Add a set of JOIN conditions to the internal array.
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
getExamplesMessages()
Returns usage examples for this module.
getPageSet()
Get the PageSet object to work on.
__construct(ApiQuery $query, $moduleName)
addWhere( $value)
Add a set of WHERE clauses to the internal array.
setContinueEnumParameter( $paramName, $paramValue)
Set a query-continue value.