-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCacheHandler.php
More file actions
41 lines (35 loc) · 1.04 KB
/
CacheHandler.php
File metadata and controls
41 lines (35 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace Fab\Formule\Processor;
/*
* This file is part of the Fab/Formule project under GPLv2 or later.
*
* For the full copyright and license information, please read the
* LICENSE.md file that was distributed with this source code.
*/
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Service\CacheService;
/**
* Class clear the cache for certain pages.
* Only an example class to be copy / pasted and adjusted!!!
*/
class CacheHandler extends AbstractProcessor
{
/**
* @param array $values
* @param string $insertOrUpdate
* @return array
*/
public function process(array $values, string $insertOrUpdate = ''): array
{
$pageIdentifiers = [1, 2, 3]; # to be defined what page id should have a cache clear.
$this->getCacheService()->clearPageCache($pageIdentifiers);
return $values;
}
/**
* @return CacheService
*/
protected function getCacheService(): CacheService
{
return GeneralUtility::makeInstance(CacheService::class);
}
}