public function FileMetadata::getSupportedKeys in File metadata manager 8
Same name and namespace in other branches
- 8.2 src/FileMetadata.php \Drupal\file_mdm\FileMetadata::getSupportedKeys()
Returns a list of supported metadata keys.
Parameters
string $metadata_id: The id of the FileMetadata plugin.
mixed $options: (optional) Allows specifying additional options to control the list of metadata keys returned.
Return value
array A simple array of metadata keys supported.
Overrides FileMetadataInterface::getSupportedKeys
File
- src/
FileMetadata.php, line 161
Class
- FileMetadata
- A file metadata object.
Namespace
Drupal\file_mdmCode
public function getSupportedKeys($metadata_id, $options = NULL) {
try {
if ($plugin = $this
->getFileMetadataPlugin($metadata_id)) {
$keys = $plugin
->getSupportedKeys($options);
}
else {
$keys = NULL;
}
} catch (\Exception $e) {
$this->logger
->error($e
->getMessage());
$keys = NULL;
}
return $keys;
}