/** * Responds to events for getting the latest metadata annotation set * * @param Hubzero\Filesystem\File $file The file to which the metadata pertains * @param int $maxEntries The maximum number of entries to return * @return array **/ public function onMetadataGet(Hubzero\Filesystem\File $file, $maxEntries = 1) { if (!$file->isLocal()) { return false; } $metadata = Metadata::loadAllByPath($file->getAbsolutePath()); $results = []; foreach ($metadata as $data) { $results[$data->key] = $data->value; } return $results; }