Key

class Key

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

Methods

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

Returns the remaining lifetime.

bool isExpired()

Details

__construct(string $resource)

Parameters

string $resource

__toString()

bool hasState(string $stateKey)

Parameters

string $stateKey

Return Value

bool

setState(string $stateKey, mixed $state)

Parameters

string $stateKey
mixed $state

removeState(string $stateKey)

Parameters

string $stateKey

mixed getState($stateKey)

Parameters

$stateKey

Return Value

mixed

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/3.4/Symfony/Component/Lock/Key.html