+ if ( !$typeOccurances ) {
+ $doRefresh = true; // delete any category table entry
+ } elseif ( count( $typeOccurances ) <= $maxSize ) {
+ $countByType = array_count_values( $typeOccurances );
+ $doRefresh = !$dbw->selectField(
+ 'category',
+ '1',
+ [
+ 'cat_title' => $this->getName(),
+ 'cat_pages' => $countByType['page'] ?? 0,
+ 'cat_subcats' => $countByType['subcat'] ?? 0,
+ 'cat_files' => $countByType['file'] ?? 0
+ ],
+ __METHOD__
+ );
+ } else {
+ $doRefresh = false; // category is too big