Zeige Medienfassungen in der Verwaltung und halte Beschreibungen davon getrennt.
Deploy Test / test (push) Successful in 15s
Deploy Test / deploy (push) Successful in 22s

Eine Fassung bleibt nummeriert und kann deaktiviert werden. Beschreibung und fachliche Säulen gehören zum Medium und legen keine neue Fassung an.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-11-15 11:25:08 +01:00
1 parent 12f12117dd
commit af85a94cd5
28 files changed
+1002 -168

No files matched your search

+33
View File
@@ -10,6 +10,8 @@
use App\Domain\Catalog\CompositionKind;
use App\Domain\Catalog\CompositionMember;
use App\Domain\Catalog\ContentElement;
use App\Domain\Catalog\ContentElementVersion;
use App\Domain\Catalog\ContentResolver;
use App\Domain\Catalog\ContentVersionStatus;
use App\Domain\Catalog\DomainRuleException;
use App\Domain\Catalog\LicenseArticle;
@@ -317,6 +319,37 @@ public function compositionMembers(Composition $composition): array
return $lines;
}
/**
* @return list<string>
*/
public function memberPillars(Composition $composition): array
{
$version = $composition->versions()
->where('status', ContentVersionStatus::Bereit)
->orderByDesc('number')
->first();
if ($version === null) {
return ['Noch keine Fassung, deshalb keine Säulen.'];
}
$rows = app(ContentResolver::class)->expand($version);
$versions = ContentElementVersion::query()
->whereIn('id', array_column($rows, 'version_id'))
->with('element.pillars')
->get()
->keyBy('id');
$lines = [];
foreach ($rows as $row) {
$element = $versions[$row['version_id']]->element;
$names = $element->pillars->pluck('name');
$lines[] = $element->working_title.' — '.($names->isEmpty() ? 'keiner Säule zugeordnet' : $names->join(', '));
}
return $lines === [] ? ['Diese Fassung enthält keine Medien.'] : $lines;
}
/**
* @return list<string>
*/