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

1
2
3
public function getOwnerId() {
  return $this->get('uid')->target_id;
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.