public function TokenManager::deleteToken in Persistent Login 8
Delete the specified token from the database, if it exists.
Parameters
\Drupal\persistent_login\PersistentToken $token: The token.
Return value
\Drupal\persistent_login\PersistentToken An invalidated token.
File
- src/
TokenManager.php, line 225
Class
- TokenManager
- Class TokenManager.
Namespace
Drupal\persistent_loginCode
public function deleteToken(PersistentToken $token) {
try {
$this->connection
->delete('persistent_login')
->condition('series', $token
->getSeries())
->condition('instance', $token
->getInstance())
->execute();
} catch (\Exception $e) {
throw new TokenException("An error occurred trying to delete the token", 0, $e);
}
return $token
->setInvalid();
}