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