Key

class Key

Key is a container for the state of the locks in stores.

Methods

__construct(string $resource)
__toString()
hasState(string $stateKey)
setState(string $stateKey, $state)
removeState(string $stateKey)
getState(string $stateKey)
resetLifetime()
reduceLifetime(float $ttl)
float|null getRemainingLifetime()

Returns the remaining lifetime.

bool isExpired()

Details

__construct(string $resource)

Parameters

string $resource

__toString()

hasState(string $stateKey)

Parameters

string $stateKey

setState(string $stateKey, $state)

Parameters

string $stateKey
$state

removeState(string $stateKey)

Parameters

string $stateKey

getState(string $stateKey)

Parameters

string $stateKey

resetLifetime()

reduceLifetime(float $ttl)

Parameters

float $ttl the expiration delay of locks in seconds

float|null getRemainingLifetime()

Returns the remaining lifetime.

Return Value

float|null Remaining lifetime in seconds. Null when the key won't expire.

bool isExpired()

Return Value

bool

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/4.0/Symfony/Component/Lock/Key.html