public function MongodbUserStorage::updateLastAccessTimestamp in MongoDB 8
Update the last access timestamp of the user.
Parameters
\Drupal\Core\Session\AccountInterface $account: The user object.
int $timestamp: The last access timestamp.
Overrides UserStorageInterface::updateLastAccessTimestamp
File
- mongodb_user/
src/ MongodbUserStorage.php, line 30 - Definition of Drupal\mongodb_user\MongodbUserStorage.
Class
Namespace
Drupal\mongodb_userCode
public function updateLastAccessTimestamp(AccountInterface $account, $timestamp) {
$this->mongo
->get('entity.user')
->update([
'_id' => $account
->id(),
], [
'$set' => [
'access' => $timestamp,
],
]);
}