PHP Класс Stash\Pool

Автор: Robert Hafner ([email protected])
Наследование: implements Stash\Interfaces\PoolInterface
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$driver Stash\Interfaces\DriverInterface The cacheDriver being used by the system. While this class handles all of the higher functions, it's the cache driver here that handles all of the storage/retrieval functionality. This value is set by the constructor.
$isDisabled boolean Is this Pool disabled.
$itemClass string Default "Item" class to use for making new items.
$logger Psr\Log\LoggerInterface If set various then errors and exceptions will get passed to the PSR Compliant logging library. This can be set using the setLogger() function in this class.
$namespace string Current namespace, if any.

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

Метод Описание
__construct ( Stash\Interfaces\DriverInterface $driver = null ) The constructor takes a Driver class which is used for persistent storage. If no driver is provided then the Ephemeral driver is used by default.
clear ( )
commit ( )
deleteItem ( $key )
deleteItems ( array $keys )
getDriver ( )
getItem ( $key )
getItems ( array $keys = [] )
getNamespace ( )
hasItem ( $key )
purge ( )
save ( Psr\Cache\CacheItemInterface $item )
saveDeferred ( Psr\Cache\CacheItemInterface $item )
setDriver ( Stash\Interfaces\DriverInterface $driver )
setItemClass ( $class )
setLogger ( $logger )
setNamespace ( $namespace = null )

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

Метод Описание
logException ( string $message, Exception $exception ) : boolean Logs an exception with the Logger class, if it exists.

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

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

The constructor takes a Driver class which is used for persistent storage. If no driver is provided then the Ephemeral driver is used by default.
public __construct ( Stash\Interfaces\DriverInterface $driver = null )
$driver Stash\Interfaces\DriverInterface

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

public clear ( )

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

public commit ( )

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

public deleteItem ( $key )

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

public deleteItems ( array $keys )
$keys array

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

public getDriver ( )

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

public getItem ( $key )

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

public getItems ( array $keys = [] )
$keys array

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

public getNamespace ( )

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

public hasItem ( $key )

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

Logs an exception with the Logger class, if it exists.
protected logException ( string $message, Exception $exception ) : boolean
$message string
$exception Exception
Результат boolean

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

public purge ( )

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

public save ( Psr\Cache\CacheItemInterface $item )
$item Psr\Cache\CacheItemInterface

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

public saveDeferred ( Psr\Cache\CacheItemInterface $item )
$item Psr\Cache\CacheItemInterface

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

public setDriver ( Stash\Interfaces\DriverInterface $driver )
$driver Stash\Interfaces\DriverInterface

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

public setItemClass ( $class )

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

public setLogger ( $logger )

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

public setNamespace ( $namespace = null )

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

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

The cacheDriver being used by the system. While this class handles all of the higher functions, it's the cache driver here that handles all of the storage/retrieval functionality. This value is set by the constructor.
protected DriverInterface,Stash\Interfaces $driver
Результат Stash\Interfaces\DriverInterface

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

Is this Pool disabled.
protected bool $isDisabled
Результат boolean

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

Default "Item" class to use for making new items.
protected string $itemClass
Результат string

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

If set various then errors and exceptions will get passed to the PSR Compliant logging library. This can be set using the setLogger() function in this class.
protected Psr\Log\LoggerInterface $logger
Результат Psr\Log\LoggerInterface

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

Current namespace, if any.
protected string $namespace
Результат string