com\setasign\SetaFramework\SimpleCache

SimpleCacheGroupWrapper Class SimpleCacheGroupWrapper

File: /SetaFramework/src/SimpleCache/SimpleCacheGroupWrapper.php

Class hierarchy

Implements

  • \Psr\SimpleCache\CacheInterface

Summary

Properties

$group


Methods

__construct()

public SimpleCacheGroupWrapper::__construct (
\Psr\SimpleCache\CacheInterface $cache,
string $group
)
Parameters
$cache : \Psr\SimpleCache\CacheInterface
 
$group : string
 

clear()

public SimpleCacheGroupWrapper::clear (
void
): bool
Return Values

True on success and false on failure.

delete()

public SimpleCacheGroupWrapper::delete (
string $key
): bool
Parameters
$key : string

The unique cache key of the item to delete.

Return Values

True if the item was successfully removed. False if there was an error.

Exceptions

Throws \Psr\SimpleCache\InvalidArgumentException

deleteMultiple()

public SimpleCacheGroupWrapper::deleteMultiple (
\Psr\SimpleCache\iterable<string> $keys
): bool
Parameters
$keys : \Psr\SimpleCache\iterable<string>

A list of string-based keys to be deleted.

Return Values

True if the items were successfully removed. False if there was an error.

Exceptions

Throws \Psr\SimpleCache\InvalidArgumentException

get()

public SimpleCacheGroupWrapper::get (
string $key,
mixed $default = null
): ?mixed
Parameters
$key : string

The unique key of this item in the cache.

$default : mixed

Default value to return if the key does not exist.

Return Values

The value of the item from the cache, or $default in case of cache miss.

Exceptions

Throws \Psr\SimpleCache\InvalidArgumentException

getMultiple()

public SimpleCacheGroupWrapper::getMultiple (
\Psr\SimpleCache\iterable<string> $keys,
mixed $default = null
): \iterable
Parameters
$keys : \Psr\SimpleCache\iterable<string>

A list of keys that can be obtained in a single operation.

$default : mixed

Default value to return for keys that do not exist.

Return Values

A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value.

Exceptions

Throws \Psr\SimpleCache\InvalidArgumentException

has()

public SimpleCacheGroupWrapper::has (
string $key
): bool
Parameters
$key : string

The cache item key.

Exceptions

Throws \Psr\SimpleCache\InvalidArgumentException

set()

public SimpleCacheGroupWrapper::set (
string $key,
mixed $value,
null|int|\DateInterval $ttl = null
): bool
Parameters
$key : string

The key of the item to store.

$value : mixed

The value of the item to store, must be serializable.

$ttl : null|int|\DateInterval

Optional. The TTL value of this item. If no value is sent and the driver supports TTL then the library may set a default value for it or let the driver take care of that.

Return Values

True on success and false on failure.

Exceptions

Throws \Psr\SimpleCache\InvalidArgumentException

setMultiple()

public SimpleCacheGroupWrapper::setMultiple (
\Psr\SimpleCache\iterable $values,
null|int|\DateInterval $ttl = null
): bool
Parameters
$values : \Psr\SimpleCache\iterable

A list of key => value pairs for a multiple-set operation.

$ttl : null|int|\DateInterval

Optional. The TTL value of this item. If no value is sent and the driver supports TTL then the library may set a default value for it or let the driver take care of that.

Return Values

True on success and false on failure.

Exceptions

Throws \Psr\SimpleCache\InvalidArgumentException