Exemple #1
0
 /**
  * Adds page cache tags by used storagePages.
  * This adds tags with the scheme tx_news_pid_[news:pid]
  *
  * @param \GeorgRinger\News\Domain\Model\Dto\NewsDemand $demand
  * @return void
  */
 public static function addPageCacheTagsByDemandObject(\GeorgRinger\News\Domain\Model\Dto\NewsDemand $demand)
 {
     $cacheTags = array();
     if ($demand->getStoragePage()) {
         // Add cache tags for each storage page
         foreach (GeneralUtility::trimExplode(',', $demand->getStoragePage()) as $pageId) {
             $cacheTags[] = 'tx_news_pid_' . $pageId;
         }
     }
     if (count($cacheTags) > 0) {
         $GLOBALS['TSFE']->addCacheTags($cacheTags);
     }
 }
Exemple #2
0
 /**
  * @test
  * @return void
  */
 public function storagePageCanBeSet()
 {
     $value = 456;
     $this->instance->setStoragePage($value);
     $this->assertEquals($value, $this->instance->getStoragePage());
 }