public static function EntityOwnerTrait::getDefaultEntityOwner in Drupal 10
Same name and namespace in other branches
- 8 core/modules/user/src/EntityOwnerTrait.php \Drupal\user\EntityOwnerTrait::getDefaultEntityOwner()
- 9 core/modules/user/src/EntityOwnerTrait.php \Drupal\user\EntityOwnerTrait::getDefaultEntityOwner()
Default value callback for 'owner' base field.
Return value
mixed A default value for the owner field.
1 method overrides EntityOwnerTrait::getDefaultEntityOwner()
- File::getDefaultEntityOwner in core/
modules/ file/ src/ Entity/ File.php - Default value callback for 'owner' base field.
File
- core/
modules/ user/ src/ EntityOwnerTrait.php, line 86
Class
- EntityOwnerTrait
- Provides a trait for entities that have an owner.
Namespace
Drupal\userCode
public static function getDefaultEntityOwner() {
return \Drupal::currentUser()
->id();
}