PHP Class MatthiasMullie\Scrapbook\Psr6\Repository
New items are created by first get()-ing them from the pool. It would be
inefficient to let such a get() immediately query the real cache (because it
may not be meant to retrieve real data, but just to set a new value)
Instead, every Item returned by get() will be a "placeholder", and once the
values are actually needed, this object will be called to go do that (along
with every other value that has not yet been resolved, while we're at it)
Mostrar archivo
Open project: matthiasmullie/scrapbook
Class Usage Examples
Protected Properties
Property |
Type |
Description |
|
$resolved |
|
Array of resolved items. |
|
$store |
MatthiasMullie\Scrapbook\KeyValueStore |
|
|
$unresolved |
|
Array of unresolved items. |
|
Public Methods
Method |
Description |
|
__construct ( MatthiasMullie\Scrapbook\KeyValueStore $store ) |
|
|
add ( string $unique, string $key ) |
Add a to-be-resolved cache key. |
|
exists ( string $unique ) : boolean |
|
|
get ( string $unique ) : mixed | null |
|
|
remove ( string $unique ) |
This repository holds the real values for all Item objects. However, if
such an item gets garbage collected, there is no point in wasting any
more memory storing that value. |
|
Protected Methods
Method |
Description |
|
resolve ( ) |
Resolve all unresolved keys at once. |
|
Method Details
__construct()
public method
public __construct ( MatthiasMullie\Scrapbook\KeyValueStore $store ) |
$store |
MatthiasMullie\Scrapbook\KeyValueStore |
|
Add a to-be-resolved cache key.
In that case, this method can be called to remove those values.
resolve()
protected method
Resolve all unresolved keys at once.
Property Details
$resolved protected_oe property
$store protected_oe property
protected KeyValueStore,MatthiasMullie\Scrapbook $store |
return |
MatthiasMullie\Scrapbook\KeyValueStore |
|
$unresolved protected_oe property
Array of unresolved items.