File::getOwnerId

public 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 122

Class

File
Defines the file entity class.

Namespace

Drupal\file\Entity

Code

public function getOwnerId() {
  return $this->get('uid')->target_id;
}
doc_Drupal
2016-10-29 09:13:14
Comments
Leave a Comment

Please login to continue.