Update metadata stub

Signed-off-by: Louis Chemineau <louis@chmn.me>
This commit is contained in:
Louis Chemineau 2023-04-12 17:43:23 +02:00 committed by backportbot-nextcloud[bot]
parent 1bc2a42286
commit 6b153326f5
1 changed files with 9 additions and 2 deletions

View File

@ -657,11 +657,18 @@ use OCP\DB\Types;
/**
* @method string getGroupName()
* @method void setGroupName(string $groupName)
* @method array getMetadata()
* @method void setMetadata(array $metadata)
* @method string getValue()
* @method void setValue(string $value)
* @see \OC\Core\Migrations\Version240000Date20220404230027
*/
class FileMetadata extends Entity {
public function getDecodedValue(): array {
return json_decode($this->getValue(), true) ?? [];
}
public function setArrayAsValue(array $value): void {
$this->setValue(json_encode($value, JSON_THROW_ON_ERROR));
}
}
}