public static function clearCache($rt_shop_product = null, $stop_here = false)
 {
     $cache = sfContext::getInstance()->getViewCacheManager();
     if ($cache) {
         rtGlobalCacheToolkit::clearCache();
         $cache->remove('rtShopProduct/index');
         // index page
         $cache->remove('rtShopProduct/index?page=*');
         // index with page
         $cache->remove('rtShopProduct/feed?format=*');
         // feed
         $cache->remove('@sf_cache_partial?module=rtShopProduct&action=_latest&sf_cache_key=*');
         $cache->remove('@sf_cache_partial?module=rtShopProduct&action=_shopProductFeatured&sf_cache_key=*');
         if ($rt_shop_product) {
             // Remove caches for categories.
             foreach ($rt_shop_product->rtShopCategories as $rt_shop_category) {
                 rtShopCategoryCacheToolkit::clearCache($rt_shop_category);
             }
             if (!$stop_here) {
                 // remove caches for categories.
                 foreach ($rt_shop_product->rtShopProductsLinked as $rt_shop_product_linked) {
                     self::clearCache($rt_shop_product_linked, true);
                 }
             }
             $cache->remove(sprintf('rtShopProduct/show?id=%s&slug=%s', $rt_shop_product->getId(), $rt_shop_product->getSlug()));
             // show page
             $cache->remove('@sf_cache_partial?module=rtShopProduct&action=_shop_product&sf_cache_key=' . $rt_shop_product->getId());
             // show page partial.
         }
     }
 }
 public static function clearCache($rt_shop_category = null)
 {
     $cache = sfContext::getInstance()->getViewCacheManager();
     if ($cache) {
         rtGlobalCacheToolkit::clearCache();
         $cache->remove('rtShopCategory/index');
         $file_cache = new sfFileCache(array('cache_dir' => sfConfig::get('sf_cache_dir') . DIRECTORY_SEPARATOR . 'frontend'));
         $file_cache->removePattern('**/rtShopCategory/_navigation/*');
         $cache->remove('@sf_cache_partial?module=rtShopCategory&action=_navigation&sf_cache_key=*');
         $cache->remove('@sf_cache_partial?module=rtShopCategory&action=_navigation&sf_cache_key=40cd750bba9870f18aada2478b24840a');
         $cache->remove('rtShopCategory/_navigation?module=rtShopCategory&action=*&sf_cache_key=*');
         //   '/1_mysite_com/all/rtShopCategory/index/page/1';
         if (!is_null($rt_shop_category)) {
             if ($rt_shop_category->getNode()->isRoot()) {
                 $cache->remove('rtShopCategory/index?page=*');
             }
             $cache->remove(sprintf('rtShopCategory/show?id=%s&slug=%s', $rt_shop_category->getId(), $rt_shop_category->getSlug()));
             // show page
             $cache->remove(sprintf('rtShopCategory/show?id=%s&slug=%s&page=*', $rt_shop_category->getId(), $rt_shop_category->getSlug()));
             // show page
             $cache->remove(sprintf('rtShopCategory/show?id=%s&slug=%s&page=*&show_more=', $rt_shop_category->getId(), $rt_shop_category->getSlug()));
             // show page
             $cache->remove('@sf_cache_partial?module=rtShopCategory&action=_shop_category&sf_cache_key=' . $rt_shop_category->getId());
             // show page partial.
         }
     }
 }
 public static function clearCache(rtWikiPage $rt_wiki_page = null)
 {
     $cache = sfContext::getInstance()->getViewCacheManager();
     if ($cache) {
         rtGlobalCacheToolkit::clearCache();
         $cache->remove('rtWikiPage/index');
         // index page
         if ($rt_wiki_page) {
             $cache->remove(sprintf('rtWikiPage/show?id=%s&slug=%s', $rt_wiki_page->getId(), $rt_wiki_page->getSlug()));
             // show page
             $cache->remove('@sf_cache_partial?module=rtWikiPage&action=_wiki_page&sf_cache_key=' . $rt_wiki_page->getId());
             // show page partial.
         }
     }
 }
 public static function clearCache($rt_site_page = null)
 {
     $cache = sfContext::getInstance()->getViewCacheManager();
     if ($cache) {
         rtGlobalCacheToolkit::clearCache();
         $cache->remove('rtSitePage/index');
         $file_cache = new sfFileCache(array('cache_dir' => sfConfig::get('sf_cache_dir') . DIRECTORY_SEPARATOR . 'frontend'));
         $file_cache->removePattern('**/rtSitePage/_navigation/*');
         $cache->remove('@sf_cache_partial?module=rtSitePage&action=_navigation&sf_cache_key=*');
         $cache->remove('@sf_cache_partial?module=rtSitePage&action=_navigation&sf_cache_key=40cd750bba9870f18aada2478b24840a');
         $cache->remove('rtSitePage/_navigation?module=rtSitePage&action=*&sf_cache_key=*');
         if (!is_null($rt_site_page)) {
             $cache->remove(sprintf('rtSitePage/show?slug=%s', $rt_site_page->getSlug()));
             // show page
             $cache->remove(sprintf('rtSitePage/show?id=%s&slug=%s', $rt_site_page->getId(), $rt_site_page->getSlug()));
             // show page
             $cache->remove('@sf_cache_partial?module=rtSitePage&action=_site_page&sf_cache_key=' . $rt_site_page->getId());
             // show page partial.
         }
     }
 }
 public static function clearCache(rtBlogPage $rt_blog_page = null)
 {
     $cache = sfContext::getInstance()->getViewCacheManager();
     if ($cache) {
         rtGlobalCacheToolkit::clearCache();
         $cache->remove('rtBlogPage/index');
         // index page
         $cache->remove('rtBlogPage/index?page=*');
         // index with page
         $cache->remove('rtBlogPage/feed?format=*');
         // feed
         $cache->remove('@sf_cache_partial?module=rtBlogPage&action=_latest&sf_cache_key=*');
         // latest posts
         $cache->remove('@sf_cache_partial?module=rtBlogPage&action=_archive&sf_cache_key=*');
         // archive
         if ($rt_blog_page) {
             $cache->remove(sprintf('rtBlogPage/show?day=%s&month=%s&slug=%s&year=%s', $rt_blog_page->getDay(), $rt_blog_page->getMonth(), $rt_blog_page->getSlug(), $rt_blog_page->getYear()));
             // show page
             $cache->remove('@sf_cache_partial?module=rtBlogPage&action=_blog_page&sf_cache_key=' . $rt_blog_page->getId());
         }
     }
 }