You are here

public function FileMetadataManager::has in File metadata manager 8.2

Same name and namespace in other branches
  1. 8 src/FileMetadataManager.php \Drupal\file_mdm\FileMetadataManager::has()

Determines if the URI is currently in use by the manager.

Parameters

string $uri: The URI to a file.

Return value

bool TRUE if the URI is in use, FALSE otherwise.

Overrides FileMetadataManagerInterface::has

File

src/FileMetadataManager.php, line 118

Class

FileMetadataManager
A service class to provide file metadata.

Namespace

Drupal\file_mdm

Code

public function has($uri) {
  $hash = $this
    ->calculateHash($uri);
  return $hash ? isset($this->files[$hash]) : FALSE;
}