You are here

public function FileMetadataPluginBase::setUri in File metadata manager 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/FileMetadata/FileMetadataPluginBase.php \Drupal\file_mdm\Plugin\FileMetadata\FileMetadataPluginBase::setUri()

Sets the URI of the file.

Parameters

string $uri: A URI.

Return value

$this

Throws

\Drupal\file_mdm\FileMetadataException If no URI is specified.

Overrides FileMetadataPluginInterface::setUri

File

src/Plugin/FileMetadata/FileMetadataPluginBase.php, line 217

Class

FileMetadataPluginBase
Abstract implementation of a base File Metadata plugin.

Namespace

Drupal\file_mdm\Plugin\FileMetadata

Code

public function setUri($uri) {
  if (!$uri) {
    throw new FileMetadataException('Missing $uri argument', $this
      ->getPluginId(), __FUNCTION__);
  }
  $this->uri = $uri;
  return $this;
}