You are here

public function File::getOwnerId in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/file/src/Entity/File.php \Drupal\file\Entity\File::getOwnerId()

Returns the entity owner's user ID.

Return value

int|null The owner user ID, or NULL in case the user ID field has not been set on the entity.

Overrides EntityOwnerInterface::getOwnerId

File

core/modules/file/src/Entity/File.php, line 123
Contains \Drupal\file\Entity\File.

Class

File
Defines the file entity class.

Namespace

Drupal\file\Entity

Code

public function getOwnerId() {
  return $this
    ->get('uid')->target_id;
}