Halte Auswirkung und Rückzug beim Veröffentlichen eines Artikel-Stands fest.
Deploy Test / test (push) Successful in 12s
Deploy Test / deploy (push) Successful in 32s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-11-15 09:07:14 +01:00
1 parent fd6860efda
commit fef0ea2ac2
11 files changed
+298 -25

No files matched your search

+13 -1
View File
@@ -28,12 +28,24 @@ protected function casts(): array
protected static function booted(): void
{
static::updating(function (ContentElementVersion $version): void {
if (in_array(StatusValue::of($version->getOriginal('status')), [
$original = StatusValue::of($version->getOriginal('status'));
if (! in_array($original, [
ContentVersionStatus::Bereit->value,
ContentVersionStatus::Gesperrt->value,
], true)) {
return;
}
$dirty = array_diff(array_keys($version->getDirty()), ['status', 'updated_at']);
if ($dirty !== [] || $original === ContentVersionStatus::Gesperrt->value) {
throw new DomainRuleException('Eine bereitgestellte Inhaltsfassung ist unveränderlich.');
}
if (StatusValue::of($version->status) !== ContentVersionStatus::Gesperrt->value) {
throw new DomainRuleException('Eine bereitgestellte Inhaltsfassung kann nur gesperrt werden.');
}
});
}