PHP Интерфейс Sulu\Component\Cache\MemoizeInterface

Показать файл Открыть проект Примеры использования интерфейса

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

Метод Описание
memoize ( callable $compute, integer $lifeTime = null ) : mixed Returns the value stored in the cache or uses the passed function to compute the value and save to cache This function uses the callstack to generate a unique key for the caching mechanism.
memoizeById ( mixed $id, array $arguments, callable $compute, integer $lifeTime = null ) : mixed Returns the value stored in the cache or uses the passed function to compute the value and save to cache This function uses the given key for the caching mechanism.

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

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

Returns the value stored in the cache or uses the passed function to compute the value and save to cache This function uses the callstack to generate a unique key for the caching mechanism.
public memoize ( callable $compute, integer $lifeTime = null ) : mixed
$compute callable
$lifeTime integer cache lifetime
Результат mixed

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

Returns the value stored in the cache or uses the passed function to compute the value and save to cache This function uses the given key for the caching mechanism.
public memoizeById ( mixed $id, array $arguments, callable $compute, integer $lifeTime = null ) : mixed
$id mixed
$arguments array array of parameter to call compute function
$compute callable
$lifeTime integer cache lifetime
Результат mixed