aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/FilesMetadata/Model/MetadataValueWrapper.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/FilesMetadata/Model/MetadataValueWrapper.php')
-rw-r--r--lib/private/FilesMetadata/Model/MetadataValueWrapper.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/private/FilesMetadata/Model/MetadataValueWrapper.php b/lib/private/FilesMetadata/Model/MetadataValueWrapper.php
index 90f1554180d..70dec89650a 100644
--- a/lib/private/FilesMetadata/Model/MetadataValueWrapper.php
+++ b/lib/private/FilesMetadata/Model/MetadataValueWrapper.php
@@ -38,6 +38,7 @@ class MetadataValueWrapper implements IMetadataValueWrapper {
private string $type;
/** @var string|int|float|bool|array|string[]|int[] */
private mixed $value = null;
+ private string $etag = '';
private bool $indexed = false;
private int $editPermission = self::EDIT_FORBIDDEN;
@@ -351,6 +352,27 @@ class MetadataValueWrapper implements IMetadataValueWrapper {
}
/**
+ * @inheritDoc
+ * @return string stored etag
+ * @since 29.0.0
+ */
+ public function getEtag(): string {
+ return $this->etag;
+ }
+
+ /**
+ * @param string $etag etag value
+ *
+ * @inheritDoc
+ * @return self
+ * @since 29.0.0
+ */
+ public function setEtag(string $etag): self {
+ $this->etag = $etag;
+ return $this;
+ }
+
+ /**
* @param bool $indexed TRUE to set the stored value as an indexed value
*
* @inheritDoc
@@ -405,6 +427,7 @@ class MetadataValueWrapper implements IMetadataValueWrapper {
public function import(array $data): self {
$this->value = $data['value'] ?? null;
$this->type = $data['type'] ?? '';
+ $this->setEtag($data['etag'] ?? '');
$this->setIndexed($data['indexed'] ?? false);
$this->setEditPermission($data['editPermission'] ?? self::EDIT_FORBIDDEN);
return $this;
@@ -414,6 +437,7 @@ class MetadataValueWrapper implements IMetadataValueWrapper {
return [
'value' => ($emptyValues) ? null : $this->value,
'type' => $this->getType(),
+ 'etag' => $this->getEtag(),
'indexed' => $this->isIndexed(),
'editPermission' => $this->getEditPermission()
];