/** * Adds page cache tags by used storagePages. * This adds tags with the scheme tx_news_pid_[news:pid] * * @param Tx_News_Domain_Model_Dto_NewsDemand $demand * @return void */ public static function addPageCacheTagsByDemandObject(Tx_News_Domain_Model_Dto_NewsDemand $demand) { $cacheTags = array(); if ($demand->getStoragePage()) { // Add cache tags for each storage page foreach (\TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $demand->getStoragePage()) as $pageId) { $cacheTags[] = 'tx_news_pid_' . $pageId; } } if (count($cacheTags) > 0) { $GLOBALS['TSFE']->addCacheTags($cacheTags); } }
/** * @test * @return void */ public function storagePageCanBeSet() { $value = 456; $this->instance->setStoragePage($value); $this->assertEquals($value, $this->instance->getStoragePage()); }
/** * Test if storagepage can be set * * @test * @return void */ public function storagePageCanBeSet() { $domainModelInstance = new Tx_News_Domain_Model_Dto_NewsDemand(); $storagePage = 'Test storagePage'; $domainModelInstance->setStoragePage($storagePage); $this->assertEquals($storagePage, $domainModelInstance->getStoragePage()); }