Skip to content

BaseCache


  • Full name: \Qubus\Cache\BaseCache
  • This class implements: CacheInterface, CacheItemPoolInterface
  • This class is an Abstract class

Properties

pool

protected \Psr\Cache\CacheItemPoolInterface $pool

cache

protected \Psr\SimpleCache\CacheInterface $cache

adapter

protected \Psr\SimpleCache\CacheInterface|\Qubus\Cache\Adapter\CacheAdapter|null $adapter

Methods

__construct

public __construct(int|null|\DateInterval $ttl = null, ?string $namespace = null): mixed

Parameters:

Parameter Type Description
$ttl int|null|\DateInterval
$namespace ?string

get

{@inheritdoc}

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

Parameters:

Parameter Type Description
$key string
$default mixed

See Also:

  • \Psr\SimpleCache\CacheInterface::get()

set

{@inheritdoc}

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

Parameters:

Parameter Type Description
$key string
$value mixed
$ttl null|int|\DateInterval

See Also:

  • \Psr\SimpleCache\CacheInterface::set()

delete

{@inheritdoc}

public delete(string $key): bool

Parameters:

Parameter Type Description
$key string

See Also:

  • \Psr\SimpleCache\CacheInterface::delete()

clear

{@inheritdoc}

public clear(): bool

See Also:

  • \Psr\SimpleCache\CacheInterface::clear()
  • \Psr\Cache\CacheInterface::clear()
  • \Qubus\Cache\Psr16\Psr16Cache::clear()

getMultiple

{@inheritdoc}

public getMultiple(iterable $keys, mixed $default = null): iterable

Parameters:

Parameter Type Description
$keys iterable
$default mixed

See Also:

  • \Psr\SimpleCache\CacheInterface::getMultiple()

setMultiple

{@inheritdoc}

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

Parameters:

Parameter Type Description
$values iterable
$ttl null|int|\DateInterval

See Also:

  • \Psr\SimpleCache\CacheInterface::setMultiple()

deleteMultiple

{@inheritdoc}

public deleteMultiple(iterable $keys): bool

Parameters:

Parameter Type Description
$keys iterable

See Also:

  • \Psr\SimpleCache\CacheInterface::deleteMultiple()

has

{@inheritdoc}

public has(string $key): bool

Parameters:

Parameter Type Description
$key string

See Also:

  • \Psr\SimpleCache\CacheInterface::has()

getItem

{@inheritdoc}

public getItem(string $key): \Psr\Cache\CacheItemInterface

Parameters:

Parameter Type Description
$key string

See Also:

  • \Psr\Cache\CacheItemPoolInterface::getItem()

getItems

{@inheritdoc}

public getItems(array $keys = []): iterable

Parameters:

Parameter Type Description
$keys array

See Also:

  • \Psr\Cache\CacheItemPoolInterface::getItems()

hasItem

{@inheritdoc}

public hasItem(string $key): bool

Parameters:

Parameter Type Description
$key string

See Also:

  • \Psr\Cache\CacheItemPoolInterface::hasItem()

deleteItem

{@inheritdoc}

public deleteItem(string $key): bool

Parameters:

Parameter Type Description
$key string

See Also:

  • \Psr\Cache\CacheItemPoolInterface::deleteItem()

deleteItems

{@inheritdoc}

public deleteItems(array $keys): bool

Parameters:

Parameter Type Description
$keys array

See Also:

  • \Psr\Cache\CacheItemPoolInterface::deleteItems()

save

{@inheritdoc}

public save(\Psr\Cache\CacheItemInterface $item): bool

Parameters:

Parameter Type Description
$item \Psr\Cache\CacheItemInterface

Throws:

See Also:

  • \Psr\Cache\CacheItemPoolInterface::save()

saveDeferred

{@inheritdoc}

public saveDeferred(\Psr\Cache\CacheItemInterface $item): bool

Parameters:

Parameter Type Description
$item \Psr\Cache\CacheItemInterface

Throws:

See Also:

  • \Psr\Cache\CacheItemPoolInterface::saveDeferred()

commit

{@inheritdoc}

public commit(): bool

See Also:

  • \Psr\Cache\CacheItemPoolInterface::commit()