Merge pull request #2245 from nextcloud/enh/etag-api

This commit is contained in:
Julius Härtl
2020-11-10 21:58:30 +01:00
committed by GitHub
21 changed files with 98 additions and 18 deletions

View File

@@ -81,4 +81,8 @@ class Board extends RelationalEntity {
$this->acl[] = $a;
}
}
public function getETag() {
return md5((string)$this->getLastModified());
}
}

View File

@@ -155,4 +155,8 @@ class Card extends RelationalEntity {
public function getCalendarPrefix(): string {
return 'card';
}
public function getETag() {
return md5((string)$this->getLastModified());
}
}

View File

@@ -36,4 +36,8 @@ class Label extends RelationalEntity {
$this->addType('cardId', 'integer');
$this->addType('lastModified', 'integer');
}
public function getETag() {
return md5((string)$this->getLastModified());
}
}

View File

@@ -80,6 +80,9 @@ class RelationalEntity extends Entity implements \JsonSerializable {
$json[$property] = $value;
}
}
if ($reflection->hasMethod('getETag')) {
$json['ETag'] = $this->getETag();
}
return $json;
}

View File

@@ -65,4 +65,8 @@ class Stack extends RelationalEntity {
public function getCalendarPrefix(): string {
return 'stack';
}
public function getETag() {
return md5((string)$this->getLastModified());
}
}