function FileRepositoryInterface::loadByUri

Same name in other branches
  1. 10 core/modules/file/src/FileRepositoryInterface.php \Drupal\file\FileRepositoryInterface::loadByUri()
  2. 11.x core/modules/file/src/FileRepositoryInterface.php \Drupal\file\FileRepositoryInterface::loadByUri()

Loads the first File entity found with the specified URI.

Parameters

string $uri: The file URI.

Return value

\Drupal\file\FileInterface|null The first file with the matched URI if found, NULL otherwise.

1 method overrides FileRepositoryInterface::loadByUri()
FileRepository::loadByUri in core/modules/file/src/FileRepository.php
Loads the first File entity found with the specified URI.

File

core/modules/file/src/FileRepositoryInterface.php, line 155

Class

FileRepositoryInterface
Performs file system operations and updates database records accordingly.

Namespace

Drupal\file

Code

public function loadByUri(string $uri) : ?FileInterface;

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.