aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_versions/lib/Db
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2022-11-29 14:52:02 +0100
committerLouis (Rebase PR Action) <artonge@users.noreply.github.com>2023-01-26 10:12:23 +0000
commit629de6c8c97f9a455944046737421b927b1e2d9b (patch)
tree25dc4a6e6dd5a339d3207a8c8fb325ecb71c1cbf /apps/files_versions/lib/Db
parente82bfba114aa291fe6bbe1de3488c685d12489a1 (diff)
downloadnextcloud-server-629de6c8c97f9a455944046737421b927b1e2d9b.tar.gz
nextcloud-server-629de6c8c97f9a455944046737421b927b1e2d9b.zip
Support getting and patching version-label
Signed-off-by: Louis Chemineau <louis@chmn.me>
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