+ // Get the aggregate `categorylinks` row counts for this category
+ $catCond = $dbw->conditional( [ 'page_namespace' => NS_CATEGORY ], 1, 'NULL' );
+ $fileCond = $dbw->conditional( [ 'page_namespace' => NS_FILE ], 1, 'NULL' );
+ $result = $dbw->selectRow(
+ [ 'categorylinks', 'page' ],
+ [
+ 'pages' => 'COUNT(*)',
+ 'subcats' => "COUNT($catCond)",
+ 'files' => "COUNT($fileCond)"
+ ],
+ [ 'cl_to' => $this->mName, 'page_id = cl_from' ],
+ __METHOD__
+ );