/**
  * Purge the cache for articles related to a given thread
  * @param int $threadId
  */
 public static function purgeCache($threadId)
 {
     $relatedPages = new WallRelatedPages();
     $ids = $relatedPages->getMessagesRelatedArticleIds($threadId, 'order_index', DB_MASTER);
     foreach ($ids as $id) {
         $key = wfMemcKey(__CLASS__, 'getData', $id);
         WikiaDataAccess::cachePurge($key);
         // VOLDEV-46: Update module by purging page, not via AJAX
         $wikiaPage = WikiPage::newFromID($id);
         if ($wikiaPage) {
             $wikiaPage->doPurge();
         } else {
             self::logError("Found a null related wikipage on thread purge", ["articleID" => $id, "threadID" => $threadId]);
         }
     }
 }