aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_versions/lib/Db
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_versions/lib/Db')
-rw-r--r--apps/files_versions/lib/Db/VersionEntity.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/files_versions/lib/Db/VersionEntity.php b/apps/files_versions/lib/Db/VersionEntity.php
index 5ef94215dd2..d5adbcfa104 100644
--- a/apps/files_versions/lib/Db/VersionEntity.php
+++ b/apps/files_versions/lib/Db/VersionEntity.php
@@ -59,7 +59,7 @@ class VersionEntity extends Entity implements JsonSerializable {
$this->addType('metadata', Types::JSON);
}
- public function jsonSerialize() {
+ public function jsonSerialize(): array {
return [
'id' => $this->id,
'file_id' => $this->fileId,
@@ -69,4 +69,13 @@ class VersionEntity extends Entity implements JsonSerializable {
'metadata' => $this->metadata,
];
}
+
+ public function getLabel(): string {
+ return $this->metadata['label'] ?? '';
+ }
+
+ public function setLabel(string $label): void {
+ $this->metadata['label'] = $label;
+ $this->markFieldUpdated('metadata');
+ }
} \ No newline at end of file