PHP Класс 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)
Автор: Matthias Mullie ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$resolved Array of resolved items.
$store MatthiasMullie\Scrapbook\KeyValueStore
$unresolved Array of unresolved items.

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
resolve ( ) Resolve all unresolved keys at once.

Описание методов

__construct() публичный Метод

public __construct ( MatthiasMullie\Scrapbook\KeyValueStore $store )
$store MatthiasMullie\Scrapbook\KeyValueStore

add() публичный Метод

Add a to-be-resolved cache key.
public add ( string $unique, string $key )
$unique string
$key string

exists() публичный Метод

public exists ( string $unique ) : boolean
$unique string
Результат boolean

get() публичный Метод

public get ( string $unique ) : mixed | null
$unique string
Результат mixed | null Value, of null if non-existent

remove() публичный Метод

In that case, this method can be called to remove those values.
public remove ( string $unique )
$unique string

resolve() защищенный Метод

Resolve all unresolved keys at once.
protected resolve ( )

Описание свойств

$resolved защищенное свойство

Array of resolved items.
protected $resolved

$store защищенное свойство

protected KeyValueStore,MatthiasMullie\Scrapbook $store
Результат MatthiasMullie\Scrapbook\KeyValueStore

$unresolved защищенное свойство

Array of unresolved items.
protected $unresolved