summaryrefslogtreecommitdiff
path: root/vendor/doctrine/orm/src/Cache/RegionsConfiguration.php
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2024-08-13 23:45:21 +0200
committerpolo <ordipolo@gmx.fr>2024-08-13 23:45:21 +0200
commitbf6655a534a6775d30cafa67bd801276bda1d98d (patch)
treec6381e3f6c81c33eab72508f410b165ba05f7e9c /vendor/doctrine/orm/src/Cache/RegionsConfiguration.php
parent94d67a4b51f8e62e7d518cce26a526ae1ec48278 (diff)
downloadAppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.zip
VERSION 0.2 doctrine ORM et entités
Diffstat (limited to 'vendor/doctrine/orm/src/Cache/RegionsConfiguration.php')
-rw-r--r--vendor/doctrine/orm/src/Cache/RegionsConfiguration.php63
1 files changed, 63 insertions, 0 deletions
diff --git a/vendor/doctrine/orm/src/Cache/RegionsConfiguration.php b/vendor/doctrine/orm/src/Cache/RegionsConfiguration.php
new file mode 100644
index 0000000..a852831
--- /dev/null
+++ b/vendor/doctrine/orm/src/Cache/RegionsConfiguration.php
@@ -0,0 +1,63 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Cache;
6
7/**
8 * Cache regions configuration
9 */
10class RegionsConfiguration
11{
12 /** @var array<string,int> */
13 private array $lifetimes = [];
14
15 /** @var array<string,int> */
16 private array $lockLifetimes = [];
17
18 public function __construct(
19 private int $defaultLifetime = 3600,
20 private int $defaultLockLifetime = 60,
21 ) {
22 }
23
24 public function getDefaultLifetime(): int
25 {
26 return $this->defaultLifetime;
27 }
28
29 public function setDefaultLifetime(int $defaultLifetime): void
30 {
31 $this->defaultLifetime = $defaultLifetime;
32 }
33
34 public function getDefaultLockLifetime(): int
35 {
36 return $this->defaultLockLifetime;
37 }
38
39 public function setDefaultLockLifetime(int $defaultLockLifetime): void
40 {
41 $this->defaultLockLifetime = $defaultLockLifetime;
42 }
43
44 public function getLifetime(string $regionName): int
45 {
46 return $this->lifetimes[$regionName] ?? $this->defaultLifetime;
47 }
48
49 public function setLifetime(string $name, int $lifetime): void
50 {
51 $this->lifetimes[$name] = $lifetime;
52 }
53
54 public function getLockLifetime(string $regionName): int
55 {
56 return $this->lockLifetimes[$regionName] ?? $this->defaultLockLifetime;
57 }
58
59 public function setLockLifetime(string $name, int $lifetime): void
60 {
61 $this->lockLifetimes[$name] = $lifetime;
62 }
63}