summaryrefslogtreecommitdiff
path: root/vendor/doctrine/orm/src/Cache/Region.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/doctrine/orm/src/Cache/Region.php')
-rw-r--r--vendor/doctrine/orm/src/Cache/Region.php73
1 files changed, 73 insertions, 0 deletions
diff --git a/vendor/doctrine/orm/src/Cache/Region.php b/vendor/doctrine/orm/src/Cache/Region.php
new file mode 100644
index 0000000..f7a1b26
--- /dev/null
+++ b/vendor/doctrine/orm/src/Cache/Region.php
@@ -0,0 +1,73 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Cache;
6
7use Doctrine\ORM\Cache\Exception\CacheException;
8
9/**
10 * Defines a contract for accessing a particular named region.
11 */
12interface Region
13{
14 /**
15 * Retrieve the name of this region.
16 */
17 public function getName(): string;
18
19 /**
20 * Determine whether this region contains data for the given key.
21 *
22 * @param CacheKey $key The cache key
23 */
24 public function contains(CacheKey $key): bool;
25
26 /**
27 * Get an item from the cache.
28 *
29 * @param CacheKey $key The key of the item to be retrieved.
30 *
31 * @return CacheEntry|null The cached entry or NULL
32 *
33 * @throws CacheException Indicates a problem accessing the item or region.
34 */
35 public function get(CacheKey $key): CacheEntry|null;
36
37 /**
38 * Get all items from the cache identified by $keys.
39 * It returns NULL if some elements can not be found.
40 *
41 * @param CollectionCacheEntry $collection The collection of the items to be retrieved.
42 *
43 * @return CacheEntry[]|null The cached entries or NULL if one or more entries can not be found
44 */
45 public function getMultiple(CollectionCacheEntry $collection): array|null;
46
47 /**
48 * Put an item into the cache.
49 *
50 * @param CacheKey $key The key under which to cache the item.
51 * @param CacheEntry $entry The entry to cache.
52 * @param Lock|null $lock The lock previously obtained.
53 *
54 * @throws CacheException Indicates a problem accessing the region.
55 */
56 public function put(CacheKey $key, CacheEntry $entry, Lock|null $lock = null): bool;
57
58 /**
59 * Remove an item from the cache.
60 *
61 * @param CacheKey $key The key under which to cache the item.
62 *
63 * @throws CacheException Indicates a problem accessing the region.
64 */
65 public function evict(CacheKey $key): bool;
66
67 /**
68 * Remove all contents of this particular cache region.
69 *
70 * @throws CacheException Indicates problem accessing the region.
71 */
72 public function evictAll(): bool;
73}