W3cubDocs

/Symfony 4.1

Key

class Key

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

Methods

__construct(string $resource)
__toString()
bool hasState(string $stateKey)
void setState(string $stateKey, $state)
void 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()

bool hasState(string $stateKey)

Parameters

string $stateKey

Return Value

bool

void setState(string $stateKey, $state)

Parameters

string $stateKey
$state

Return Value

void

void removeState(string $stateKey)

Parameters

string $stateKey

Return Value

void

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.
https://api.symfony.com/4.1/Symfony/Component/Lock/Key.html