foreach ( $output->getCategoryLinks() as $category ) {
$categoryTitle = Title::makeTitleSafe( NS_CATEGORY, $category );
$linkBatch->addObj( $categoryTitle );
foreach ( $output->getCategoryLinks() as $category ) {
$categoryTitle = Title::makeTitleSafe( NS_CATEGORY, $category );
$linkBatch->addObj( $categoryTitle );