mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-06 14:54:57 +00:00
Improve admin UX for configuration of document template (document generation)
This commit is contained in:
@@ -104,6 +104,12 @@ final class StoredObjectManager implements StoredObjectManagerInterface
|
||||
)
|
||||
: $clearContent;
|
||||
|
||||
$headers = [];
|
||||
|
||||
if (null !== $document->getDeleteAt()) {
|
||||
$headers['X-Delete-At'] = $document->getDeleteAt()->getTimestamp();
|
||||
}
|
||||
|
||||
try {
|
||||
$response = $this
|
||||
->client
|
||||
@@ -118,6 +124,7 @@ final class StoredObjectManager implements StoredObjectManagerInterface
|
||||
->url,
|
||||
[
|
||||
'body' => $encryptedContent,
|
||||
'headers' => $headers,
|
||||
]
|
||||
);
|
||||
} catch (TransportExceptionInterface $exception) {
|
||||
@@ -129,6 +136,11 @@ final class StoredObjectManager implements StoredObjectManagerInterface
|
||||
}
|
||||
}
|
||||
|
||||
public function clearCache(): void
|
||||
{
|
||||
$this->inMemory = [];
|
||||
}
|
||||
|
||||
private function extractLastModifiedFromResponse(ResponseInterface $response): \DateTimeImmutable
|
||||
{
|
||||
$lastModifiedString = (($response->getHeaders()['last-modified'] ?? [])[0] ?? '');
|
||||
|
@@ -12,6 +12,7 @@ declare(strict_types=1);
|
||||
namespace Chill\DocStoreBundle\Service;
|
||||
|
||||
use Chill\DocStoreBundle\Entity\StoredObject;
|
||||
use Chill\DocStoreBundle\Exception\StoredObjectManagerException;
|
||||
|
||||
interface StoredObjectManagerInterface
|
||||
{
|
||||
@@ -23,6 +24,8 @@ interface StoredObjectManagerInterface
|
||||
* @param StoredObject $document the document
|
||||
*
|
||||
* @return string the retrieved content in clear
|
||||
*
|
||||
* @throws StoredObjectManagerException if unable to read or decrypt the content
|
||||
*/
|
||||
public function read(StoredObject $document): string;
|
||||
|
||||
@@ -31,6 +34,10 @@ interface StoredObjectManagerInterface
|
||||
*
|
||||
* @param StoredObject $document the document
|
||||
* @param $clearContent The content to store in clear
|
||||
*
|
||||
* @throws StoredObjectManagerException
|
||||
*/
|
||||
public function write(StoredObject $document, string $clearContent): void;
|
||||
|
||||
public function clearCache(): void;
|
||||
}
|
||||
|
Reference in New Issue
Block a user