Mache Auswahl, Aufbau und Entwurf im Redaktionseditor bedienbar.
Deploy Test / test (push) Successful in 22s
Deploy Test / deploy (push) Successful in 23s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-11-16 16:40:50 +01:00
1 parent 6955830579
commit 053a361801
14 files changed
+1040 -155

No files matched your search

+2
View File
@@ -19,6 +19,7 @@ class Composition extends Model
'kind',
'editorial_content_kind_id',
'archived_at',
'working_draft',
];
protected function casts(): array
@@ -26,6 +27,7 @@ protected function casts(): array
return [
'kind' => CompositionKind::class,
'archived_at' => 'datetime',
'working_draft' => 'array',
];
}
@@ -0,0 +1,35 @@
<?php
namespace App\Domain\Catalog;
class EditorialWorkingDraft
{
/**
* @return array<string, mixed>|null
*/
public function read(Composition $composition): ?array
{
$draft = $composition->working_draft;
return is_array($draft) && $draft !== [] ? $draft : null;
}
/**
* @param array<string, mixed> $payload
*/
public function write(Composition $composition, array $payload): void
{
$composition->working_draft = $payload;
$composition->save();
}
public function clear(Composition $composition): void
{
if ($composition->working_draft === null) {
return;
}
$composition->working_draft = null;
$composition->save();
}
}