function DatabaseTableTrait::init
2 calls to DatabaseTableTrait::init()
- DoctrineDbalStore::__construct in vendor/
symfony/ lock/ Store/ DoctrineDbalStore.php - List of available options:
- PdoStore::__construct in vendor/
symfony/ lock/ Store/ PdoStore.php - You can either pass an existing database connection as PDO instance or a DSN string that will be used to lazy-connect to the database when the lock is actually used.
File
-
vendor/
symfony/ lock/ Store/ DatabaseTableTrait.php, line 30
Class
- DatabaseTableTrait
- @internal
Namespace
Symfony\Component\Lock\StoreCode
private function init(array $options, float $gcProbability, int $initialTtl) : void {
if ($gcProbability < 0 || $gcProbability > 1) {
throw new InvalidArgumentException(\sprintf('"%s" requires gcProbability between 0 and 1, "%f" given.', __METHOD__, $gcProbability));
}
if ($initialTtl < 1) {
throw new InvalidTtlException(\sprintf('"%s()" expects a strictly positive TTL, "%d" given.', __METHOD__, $initialTtl));
}
$this->table = $options['db_table'] ?? $this->table;
$this->idCol = $options['db_id_col'] ?? $this->idCol;
$this->tokenCol = $options['db_token_col'] ?? $this->tokenCol;
$this->expirationCol = $options['db_expiration_col'] ?? $this->expirationCol;
$this->gcProbability = $gcProbability;
$this->initialTtl = $initialTtl;
}