You are here

public static function EntityOwnerTrait::getDefaultAuthorId in CRM Core 8.2

Same name and namespace in other branches
  1. 8 src/EntityOwnerTrait.php \Drupal\crm_core\EntityOwnerTrait::getDefaultAuthorId()

Default value callback for 'uid' base field definition.

Return value

int The user ID.

See also

::baseFieldDefinitions()

File

src/EntityOwnerTrait.php, line 39

Class

EntityOwnerTrait
Trait implementing the various methods defined in EntityOwnerInterface.

Namespace

Drupal\crm_core

Code

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