aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_versions/lib/Db/VersionEntity.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_versions/lib/Db/VersionEntity.php')
-rw-r--r--apps/files_versions/lib/Db/VersionEntity.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/files_versions/lib/Db/VersionEntity.php b/apps/files_versions/lib/Db/VersionEntity.php
index a37171ef93f..1e1eca86886 100644
--- a/apps/files_versions/lib/Db/VersionEntity.php
+++ b/apps/files_versions/lib/Db/VersionEntity.php
@@ -78,4 +78,23 @@ class VersionEntity extends Entity implements JsonSerializable {
$this->metadata['label'] = $label;
$this->markFieldUpdated('metadata');
}
+
+ /**
+ * @abstract given a key, return the value associated with the key in the metadata column
+ * if nothing is found, we return an empty string
+ * @param string $key key associated with the value
+ */
+ public function getMetadataValue(string $key): string {
+ return $this->metadata[$key] ?? '';
+ }
+
+ /**
+ * @abstract sets a key value pair in the metadata column
+ * @param string $key key associated with the value
+ * @param string $value value associated with the key
+ */
+ public function setMetadataValue(string $key, $value): void {
+ $this->metadata[$key] = $value;
+ $this->markFieldUpdated('metadata');
+ }
}