UserStorage::updateLastLoginTimestamp

public UserStorage::updateLastLoginTimestamp(UserInterface $account)

Update the last login timestamp of the user.

Parameters

\Drupal\user\UserInterface $account:

Overrides UserStorageInterface::updateLastLoginTimestamp

File

core/modules/user/src/UserStorage.php, line 41

Class

UserStorage
Controller class for users.

Namespace

Drupal\user

Code

public function updateLastLoginTimestamp(UserInterface $account) {
  $this->database->update('users_field_data')
    ->fields(array('login' => $account->getLastLoginTime()))
    ->condition('uid', $account->id())
    ->execute();
  // Ensure that the entity cache is cleared.
  $this->resetCache(array($account->id()));
}
doc_Drupal
2016-10-29 09:53:08
Comments
Leave a Comment

Please login to continue.