You are here

public function User::setLastLoginTime in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/user/src/Entity/User.php \Drupal\user\Entity\User::setLastLoginTime()

Sets the UNIX timestamp when the user last logged in.

Parameters

int $timestamp: Timestamp of the last login time.

Return value

$this The called user entity.

Overrides UserInterface::setLastLoginTime

File

core/modules/user/src/Entity/User.php, line 281

Class

User
Defines the user entity class.

Namespace

Drupal\user\Entity

Code

public function setLastLoginTime($timestamp) {
  $this
    ->get('login')->value = $timestamp;
  return $this;
}