/**
  * Expires path cache fo the page and subpages.
  *
  * @param int $pageId
  * @param int $languageId
  * @return void
  */
 protected function expireCachesForPageAndSubpages($pageId, $languageId)
 {
     $this->cache->expirePathCache($pageId, $languageId);
     $this->cache->clearUrlCacheForPage($pageId);
     $subpages = BackendUtility::getRecordsByField('pages', 'pid', $pageId);
     $uidList = array();
     foreach ($subpages as $subpage) {
         $uidList[] = (int) $subpage['uid'];
     }
     unset($subpages);
     foreach ($uidList as $uid) {
         $this->cache->expirePathCache($uid, $languageId);
         $this->expireCachesForPageAndSubpages($uid, $languageId);
     }
 }
 /**
  * Expires cache for the page and subpages.
  *
  * @param int $pageId
  * @param int $languageId
  * @param int $level
  * @return void
  */
 protected function expireCachesForPageAndSubpages($pageId, $languageId, $level = 0)
 {
     $this->cache->expireCache($pageId, $languageId);
     if ($level++ < 20) {
         $subpages = BackendUtility::getRecordsByField('pages', 'pid', $pageId);
         if (is_array($subpages)) {
             $uidList = array();
             foreach ($subpages as $subpage) {
                 $uidList[] = (int) $subpage['uid'];
             }
             unset($subpages);
             foreach ($uidList as $uid) {
                 $this->cache->expireCache($uid, $languageId);
                 $this->expireCachesForPageAndSubpages($uid, $languageId, $level);
             }
         }
     }
 }