You are here

public static function Vote::getCurrentUserId in Voting API 8.3

Default value callback for 'user' base field definition.

Return value

int The user ID of the user who submitted the vote.

See also

::baseFieldDefinitions()

File

src/Entity/Vote.php, line 244

Class

Vote
Defines the Vote entity.

Namespace

Drupal\votingapi\Entity

Code

public static function getCurrentUserId() {
  return \Drupal::currentUser()
    ->id();
}