Pool
+ Inheritance diagram for Pool:

Description

Pools entities in runtime memory.

Public Properties

 $gids = []
 

Public Methods

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...
 
void remove (array $keys)
 

Protected Methods

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

Methods

◆ _add()

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

Reimplemented in SimpleCachePool.

◆ _addKeys()

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

Reimplemented in SimpleCachePool.

◆ _get()

null AbstractEntity _get ( string  $key,
Api|Data  $caller 
)
protected
Parameters
string$key
Api | Data$callerFor hydration if needed.
Returns
null|AbstractEntity

Reimplemented in SimpleCachePool.

◆ _has()

bool _has ( string  $key)
protected

Polls.

Does not guarantee a subsequent hit.

Parameters
string$key
Returns
bool

Reimplemented in SimpleCachePool.

◆ add()

void add ( AbstractEntity  $entity)
final

This is final to ensure pH balance.

Subclasses must override the internal methods instead of this.

Parameters
AbstractEntity$entity
Returns
void

◆ get()

null AbstractEntity get ( string  $key,
Api|Data  $caller,
Closure  $factory 
)
final

This is final to ensure pH balance.

Subclasses must override the internal methods instead of this.

Parameters
string$key
Api | Data$caller
Closure$factoryfn( Api|Data $caller ): null|AbstractEntity
Returns
null|AbstractEntity

◆ remove()

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

Reimplemented in SimpleCachePool.