|
| 1 | +<?php |
| 2 | +declare(strict_types=1); |
| 3 | + |
| 4 | +/** |
| 5 | + * Pimcore |
| 6 | + * |
| 7 | + * This source file is available under two different licenses: |
| 8 | + * - GNU General Public License version 3 (GPLv3) |
| 9 | + * - Pimcore Commercial License (PCL) |
| 10 | + * Full copyright and license information is available in |
| 11 | + * LICENSE.md which is distributed with this source code. |
| 12 | + * |
| 13 | + * @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) |
| 14 | + * @license http://www.pimcore.org/license GPLv3 and PCL |
| 15 | + */ |
| 16 | + |
| 17 | +namespace Pimcore\Bundle\StaticResolverBundle\Contract\Lib; |
| 18 | + |
| 19 | +use DateInterval; |
| 20 | +use Pimcore\Cache; |
| 21 | + |
| 22 | +class CacheResolverContract implements CacheResolverContractInterface |
| 23 | +{ |
| 24 | + public function load(string $key): mixed |
| 25 | + { |
| 26 | + return Cache::load($key); |
| 27 | + } |
| 28 | + |
| 29 | + public function remove(string $key): bool |
| 30 | + { |
| 31 | + return Cache::remove($key); |
| 32 | + } |
| 33 | + |
| 34 | + public function clearAll(): bool |
| 35 | + { |
| 36 | + return Cache::clearAll(); |
| 37 | + } |
| 38 | + |
| 39 | + public function clearTag(string $tag): bool |
| 40 | + { |
| 41 | + return Cache::clearTag($tag); |
| 42 | + } |
| 43 | + |
| 44 | + public function disable(): void |
| 45 | + { |
| 46 | + Cache::disable(); |
| 47 | + } |
| 48 | + |
| 49 | + public function save( |
| 50 | + mixed $data, |
| 51 | + string $key, |
| 52 | + array $tags = [], |
| 53 | + DateInterval|int|null $lifetime = null, |
| 54 | + int $priority = 0, |
| 55 | + bool $force = false |
| 56 | + ): void { |
| 57 | + Cache::save($data, $key, $tags, $lifetime, $priority, $force); |
| 58 | + } |
| 59 | + |
| 60 | + public function isEnabled(): bool |
| 61 | + { |
| 62 | + return Cache::isEnabled(); |
| 63 | + } |
| 64 | + |
| 65 | + public function enable(): void |
| 66 | + { |
| 67 | + Cache::enable(); |
| 68 | + } |
| 69 | + |
| 70 | + public function clearTags(array $tag = []): bool |
| 71 | + { |
| 72 | + return Cache::clearTags($tag); |
| 73 | + } |
| 74 | + |
| 75 | + public function addClearTagOnShutdown(string $tag): void |
| 76 | + { |
| 77 | + Cache::addClearTagOnShutdown($tag); |
| 78 | + } |
| 79 | + |
| 80 | + public function addIgnoredTagOnSave(string $tag): void |
| 81 | + { |
| 82 | + Cache::addIgnoredTagOnSave($tag); |
| 83 | + } |
| 84 | + |
| 85 | + public function removeIgnoredTagOnSave(string $tag): void |
| 86 | + { |
| 87 | + Cache::removeIgnoredTagOnSave($tag); |
| 88 | + } |
| 89 | + |
| 90 | + public function addIgnoredTagOnClear(string $tag): void |
| 91 | + { |
| 92 | + Cache::addIgnoredTagOnClear($tag); |
| 93 | + } |
| 94 | + |
| 95 | + public function removeIgnoredTagOnClear(string $tag): void |
| 96 | + { |
| 97 | + Cache::removeIgnoredTagOnClear($tag); |
| 98 | + } |
| 99 | + |
| 100 | + public function setForceImmediateWrite(bool $force): void |
| 101 | + { |
| 102 | + Cache::setForceImmediateWrite($force); |
| 103 | + } |
| 104 | + |
| 105 | + public function getForceImmediateWrite(): bool |
| 106 | + { |
| 107 | + return Cache::getForceImmediateWrite(); |
| 108 | + } |
| 109 | +} |
0 commit comments