mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Add history support to StoredObject entity
This commit adds a history saving feature to the StoredObject entity, which allows saving versions of the object's changes over time. This is achieved by implementing a saveHistory method that captures data attributes like filename, IV, key information, and type. The corresponding Automated tests were also created. Furthermore, adjustments were made to the StoredObject test to align with the new feature.
This commit is contained in:
@@ -354,4 +354,19 @@ class StoredObject implements AsyncFileInterface, Document, TrackCreationInterfa
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function saveHistory(): void
|
||||
{
|
||||
if ('' === $this->getFilename()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->datas['history'][] = [
|
||||
'filename' => $this->getFilename(),
|
||||
'iv' => $this->getIv(),
|
||||
'key_infos' => $this->getKeyInfos(),
|
||||
'type' => $this->getType(),
|
||||
'before' => (new \DateTimeImmutable('now'))->getTimestamp(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user