User::setLastAccessTime

public User::setLastAccessTime($timestamp)

Sets the UNIX timestamp when the user last accessed the site..

Parameters

int $timestamp: Timestamp of the last access.

Return value

\Drupal\user\UserInterface The called user entity.

Overrides UserInterface::setLastAccessTime

File

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

Class

User
Defines the user entity class.

Namespace

Drupal\user\Entity

Code

public function setLastAccessTime($timestamp) {
  $this->get('access')->value = $timestamp;
  return $this;
}
doc_Drupal
2016-10-29 09:52:10
Comments
Leave a Comment

Please login to continue.