You are here

public static function Workspace::getCurrentUserId in Drupal 8

Default value callback for 'uid' base field definition.

Return value

int[] An array containing the ID of the current user.

Deprecated

The ::getCurrentUserId method is deprecated in 8.6.x and will be removed before 9.0.0.

File

core/modules/workspaces/src/Entity/Workspace.php, line 205

Class

Workspace
The workspace entity class.

Namespace

Drupal\workspaces\Entity

Code

public static function getCurrentUserId() {
  @trigger_error('The ::getCurrentUserId method is deprecated in 8.6.x and will be removed before 9.0.0.', E_USER_DEPRECATED);
  return [
    \Drupal::currentUser()
      ->id(),
  ];
}