public function UserSession::id in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Session/UserSession.php \Drupal\Core\Session\UserSession::id()
Returns the user ID or 0 for anonymous.
Return value
int The user ID.
Overrides AccountInterface::id
1 call to UserSession::id()
- UserSession::hasPermission in core/
lib/ Drupal/ Core/ Session/ UserSession.php - Checks whether a user has a certain permission.
File
- core/
lib/ Drupal/ Core/ Session/ UserSession.php, line 85
Class
- UserSession
- An implementation of the user account interface for the global user.
Namespace
Drupal\Core\SessionCode
public function id() {
return $this->uid;
}