Returns the user ID or 0 for anonymous.
Return value
int
The user ID.
Overrides AccountInterface::id
File
- drupal/core/lib/Drupal/Core/Session/UserSession.php, line 83
- Contains \Drupal\Core\Session\UserSession.
Class
- UserSession
- An implementation of the user account interface for the global user.
Namespace
Drupal\Core\Session
Code
public function id() {
return $this->uid;
}