diff options
Diffstat (limited to 'vendor/doctrine/orm/src/Cache/CacheConfiguration.php')
-rw-r--r-- | vendor/doctrine/orm/src/Cache/CacheConfiguration.php | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/vendor/doctrine/orm/src/Cache/CacheConfiguration.php b/vendor/doctrine/orm/src/Cache/CacheConfiguration.php new file mode 100644 index 0000000..0f8dea7 --- /dev/null +++ b/vendor/doctrine/orm/src/Cache/CacheConfiguration.php | |||
@@ -0,0 +1,60 @@ | |||
1 | <?php | ||
2 | |||
3 | declare(strict_types=1); | ||
4 | |||
5 | namespace Doctrine\ORM\Cache; | ||
6 | |||
7 | use Doctrine\ORM\Cache\Logging\CacheLogger; | ||
8 | |||
9 | /** | ||
10 | * Configuration container for second-level cache. | ||
11 | */ | ||
12 | class CacheConfiguration | ||
13 | { | ||
14 | private CacheFactory|null $cacheFactory = null; | ||
15 | private RegionsConfiguration|null $regionsConfig = null; | ||
16 | private CacheLogger|null $cacheLogger = null; | ||
17 | private QueryCacheValidator|null $queryValidator = null; | ||
18 | |||
19 | public function getCacheFactory(): CacheFactory|null | ||
20 | { | ||
21 | return $this->cacheFactory; | ||
22 | } | ||
23 | |||
24 | public function setCacheFactory(CacheFactory $factory): void | ||
25 | { | ||
26 | $this->cacheFactory = $factory; | ||
27 | } | ||
28 | |||
29 | public function getCacheLogger(): CacheLogger|null | ||
30 | { | ||
31 | return $this->cacheLogger; | ||
32 | } | ||
33 | |||
34 | public function setCacheLogger(CacheLogger $logger): void | ||
35 | { | ||
36 | $this->cacheLogger = $logger; | ||
37 | } | ||
38 | |||
39 | public function getRegionsConfiguration(): RegionsConfiguration | ||
40 | { | ||
41 | return $this->regionsConfig ??= new RegionsConfiguration(); | ||
42 | } | ||
43 | |||
44 | public function setRegionsConfiguration(RegionsConfiguration $regionsConfig): void | ||
45 | { | ||
46 | $this->regionsConfig = $regionsConfig; | ||
47 | } | ||
48 | |||
49 | public function getQueryValidator(): QueryCacheValidator | ||
50 | { | ||
51 | return $this->queryValidator ??= new TimestampQueryCacheValidator( | ||
52 | $this->cacheFactory->getTimestampRegion(), | ||
53 | ); | ||
54 | } | ||
55 | |||
56 | public function setQueryValidator(QueryCacheValidator $validator): void | ||
57 | { | ||
58 | $this->queryValidator = $validator; | ||
59 | } | ||
60 | } | ||