function PdoStore::exists
Overrides PersistingStoreInterface::exists
1 call to PdoStore::exists()
- PdoStore::putOffExpiration in vendor/
symfony/ lock/ Store/ PdoStore.php - Extends the TTL of a resource.
File
-
vendor/
symfony/ lock/ Store/ PdoStore.php, line 160
Class
- PdoStore
- PdoStore is a PersistingStoreInterface implementation using a PDO connection.
Namespace
Symfony\Component\Lock\StoreCode
public function exists(Key $key) : bool {
$sql = "SELECT 1 FROM {$this->table} WHERE {$this->idCol} = :id AND {$this->tokenCol} = :token AND {$this->expirationCol} > {$this->getCurrentTimestampStatement()}";
$stmt = $this->getConnection()
->prepare($sql);
$stmt->bindValue(':id', $this->getHashedKey($key));
$stmt->bindValue(':token', $this->getUniqueToken($key));
$result = $stmt->execute();
return (bool) (\is_object($result) ? $result->fetchOne() : $stmt->fetchColumn());
}