Final Class Yiisoft\Cache\NullCache
| Inheritance | Yiisoft\Cache\NullCache |
|---|---|
| Implements | Psr\SimpleCache\CacheInterface |
NullCache does not cache anything reporting success for all methods calls.
By replacing it with some other cache component, one can quickly switch from non-caching mode to caching mode.
See {@see \Psr\SimpleCache\CacheInterface} for common cache operations that NullCache supports.
Public Methods
Method Details
| public boolean delete ( mixed $key ) | ||
| $key | mixed | |
public function delete($key): bool
{
$this->validateKey($key);
return true;
}
| public boolean deleteMultiple ( iterable $keys ) | ||
| $keys | iterable | |
public function deleteMultiple(iterable $keys): bool
{
$keys = $this->iterableToArray($keys);
/** @psalm-suppress RedundantCondition */
$this->validateKeys($keys);
return true;
}
| public mixed get ( string $key, mixed $default = null ) | ||
| $key | string | |
| $default | mixed | |
public function get(string $key, mixed $default = null): mixed
{
$this->validateKey($key);
return $default;
}
| public iterable getMultiple ( iterable $keys, mixed $default = null ) | ||
| $keys | iterable | |
| $default | mixed | |
public function getMultiple(iterable $keys, mixed $default = null): iterable
{
$keys = $this->iterableToArray($keys);
/** @psalm-suppress RedundantCondition */
$this->validateKeys($keys);
return array_fill_keys($keys, $default);
}
| public boolean has ( string $key ) | ||
| $key | string | |
public function has(string $key): bool
{
$this->validateKey($key);
return false;
}
| public boolean set ( string $key, mixed $value, null|integer|DateInterval $ttl = null ) | ||
| $key | string | |
| $value | mixed | |
| $ttl | null|integer|DateInterval | |
public function set(string $key, mixed $value, null|int|DateInterval $ttl = null): bool
{
$this->validateKey($key);
return true;
}
| public boolean setMultiple ( iterable $values, null|integer|DateInterval $ttl = null ) | ||
| $values | iterable | |
| $ttl | null|integer|DateInterval | |
public function setMultiple(iterable $values, null|int|DateInterval $ttl = null): bool
{
$values = $this->iterableToArray($values);
$this->validateKeysOfValues($values);
return true;
}
Signup or Login in order to comment.