SimpleCachePool
+ Inheritance diagram for SimpleCachePool:

Description

Adapts a PSR-16 SimpleCache instance to the runtime entity pool.

Requires psr/simple-cache (any version).

Concurrency locks can be implemented by extending this class.

See also
https://www.php-fig.org/psr/psr-16/
FileCache

Protected Properties

readonly CacheInterface CacheInterface $cache
 
int int $ttl = 3600
 

Public Methods

 __construct (CacheInterface $cache)
 
int getTtl ()
 
void remove (array $keys)
 
$this setTtl (int $ttl)
 
- Public Methods inherited from Pool
void add (AbstractEntity $entity)
 This is final to ensure pH balance. More...
 
null AbstractEntity get (string $key, Api|Data $caller, Closure $factory)
 This is final to ensure pH balance. More...
 

Protected Methods

void _add (AbstractEntity $entity)
 
void _addKeys (AbstractEntity $entity, string ... $keys)
 
null AbstractEntity _get (string $key, Api|Data $caller)
 
bool _has (string $key)
 

Additional Inherited Members

- Public Properties inherited from Pool
 $gids = []
 

Constructor

◆ __construct()

__construct ( CacheInterface  $cache)
Parameters
CacheInterface$cache

Methods

◆ _add()

void _add ( AbstractEntity  $entity)
protected
Parameters
AbstractEntity$entity
Returns
void

Reimplemented from Pool.

◆ _addKeys()

void _addKeys ( AbstractEntity  $entity,
string ...  $keys 
)
protected
Parameters
AbstractEntity$entity
string[]$keys
Returns
void

Reimplemented from Pool.

◆ _get()

null AbstractEntity _get ( string  $key,
Api|Data  $caller 
)
protected
Parameters
string$key
Api | Data$caller
Returns
null|AbstractEntity

Reimplemented from Pool.

◆ _has()

bool _has ( string  $key)
protected
Parameters
string$key
Returns
bool

Reimplemented from Pool.

◆ getTtl()

int getTtl ( )
final
Returns
int

◆ remove()

void remove ( array  $keys)
Parameters
string[]$keys
Returns
void

Reimplemented from Pool.

◆ setTtl()

$this setTtl ( int  $ttl)
final
Parameters
int$ttl
Returns
$this