1: | <?php declare(strict_types=1); |
2: | |
3: | namespace Salient\Core\Facade; |
4: | |
5: | use Salient\Cache\CacheStore; |
6: | use Salient\Contract\Cache\CacheInterface; |
7: | use Salient\Core\AbstractFacade; |
8: | use DateInterval; |
9: | use DateTimeInterface; |
10: | |
11: | /** |
12: | * A facade for the global cache store |
13: | * |
14: | * @method static CacheInterface asOfNow(int|null $now = null) Get a copy of the store where items do not expire over time (see {@see CacheInterface::asOfNow()}) |
15: | * @method static true clear() Delete all items (see {@see CacheInterface::clear()}) |
16: | * @method static void close() Close the store and any underlying resources (see {@see CacheInterface::close()}) |
17: | * @method static true delete(string $key) Delete an item stored under a given key (see {@see CacheInterface::delete()}) |
18: | * @method static true deleteMultiple(iterable<string> $keys) Delete items stored under the given keys (see {@see CacheInterface::deleteMultiple()}) |
19: | * @method static mixed get(string $key, mixed $default = null) Retrieve an item stored under a given key (see {@see CacheInterface::get()}) |
20: | * @method static mixed[]|null getArray(string $key, mixed[]|null $default = null) Retrieve an array stored under a given key (see {@see CacheInterface::getArray()}) |
21: | * @method static object|null getInstanceOf(string $key, class-string $class, object|null $default = null) Retrieve an instance of a class stored under a given key (see {@see CacheInterface::getInstanceOf()}) |
22: | * @method static int|null getInt(string $key, int|null $default = null) Retrieve an integer stored under a given key (see {@see CacheInterface::getInt()}) |
23: | * @method static int getItemCount() Get the number of unexpired items in the store |
24: | * @method static string[] getItemKeys() Get a list of keys under which unexpired items are stored |
25: | * @method static iterable<string,mixed> getMultiple(iterable<string> $keys, mixed $default = null) Retrieve items stored under the given keys (see {@see CacheInterface::getMultiple()}) |
26: | * @method static string|null getString(string $key, string|null $default = null) Retrieve a string stored under a given key (see {@see CacheInterface::getString()}) |
27: | * @method static bool has(string $key) Check if an item exists and has not expired (see {@see CacheInterface::has()}) |
28: | * @method static true set(string $key, mixed $value, DateTimeInterface|DateInterval|int|null $ttl = null) Store an item under a given key (see {@see CacheInterface::set()}) |
29: | * @method static true setMultiple(iterable<string,mixed> $values, DateTimeInterface|DateInterval|int|null $ttl = null) Store items under the given keys (see {@see CacheInterface::setMultiple()}) |
30: | * |
31: | * @api |
32: | * |
33: | * @extends AbstractFacade<CacheInterface> |
34: | * |
35: | * @generated |
36: | */ |
37: | final class Cache extends AbstractFacade |
38: | { |
39: | /** |
40: | * @internal |
41: | */ |
42: | protected static function getService() |
43: | { |
44: | return [ |
45: | CacheInterface::class => CacheStore::class, |
46: | ]; |
47: | } |
48: | } |
49: |