Texte, Materialart und Präsentationsmedien bleiben am Medium, Modul, Programm und Lizenzartikel und werden von Verwaltung und Karten aus derselben Quelle gelesen, ohne Fassung oder Lizenz zu verändern. Co-authored-by: Cursor <cursoragent@cursor.com>
60 lines
2.3 KiB
PHP
60 lines
2.3 KiB
PHP
<?php
|
|
|
|
namespace App\Domain\Cms\Catalog;
|
|
|
|
/**
|
|
* Anzeigedaten des Fachobjekts hinter einer Premium-Karte (Thema, Medium/Material, Programm/Modul).
|
|
* Wird zur Laufzeit aus den maßgeblichen Fachdaten gelesen und nie im CMS gespeichert.
|
|
*
|
|
* - url: nur ein öffentlich freigegebenes Ziel aus dem Fachobjekt (Themenseite, Programmseite), sonst null.
|
|
* - public: false heißt „nur in der Redaktionsvorschau“; öffentlich entfällt die Karte dann.
|
|
* - notice: redaktioneller Hinweis für die Vorschau, warum die Karte öffentlich nicht erscheint.
|
|
* - visual: Darstellung ohne Kartenbild: 'film' (Medientafel Film), 'material' (Materialsymbol),
|
|
* 'catalog' (Navy-Tafel Programm/Modul) oder null (Karte ohne Bildbereich).
|
|
* - previewImage: geschütztes Vorschaubild der Bibliothek (Filmstandbild, Vorschau des Moduls). Nur für die
|
|
* Redaktionsvorschau (Route editorial.card, nur für angemeldete Redaktion); öffentlich nie ausgegeben, weil es
|
|
* keine Freigabe für die Website hat.
|
|
* - missing: was für eine vollständige Karte fehlt, als Hinweis nur in der Redaktionsvorschau.
|
|
*/
|
|
final readonly class CardSubject
|
|
{
|
|
/**
|
|
* @param list<string> $meta reine Anzeigetexte aus Fachdaten
|
|
* @param list<string> $missing Hinweise für die Redaktion
|
|
*/
|
|
public function __construct(
|
|
public string $title,
|
|
public ?string $summary,
|
|
public string $kind,
|
|
public ?string $badge,
|
|
public array $meta,
|
|
public ?string $url,
|
|
public bool $public,
|
|
public ?string $notice = null,
|
|
public ?string $visual = null,
|
|
public ?string $visualLabel = null,
|
|
public ?string $previewImage = null,
|
|
public array $missing = [],
|
|
public ?string $style = null,
|
|
) {}
|
|
|
|
public function withText(?string $title, ?string $summary): self
|
|
{
|
|
return new self(
|
|
title: $title ?? $this->title,
|
|
summary: $summary ?? $this->summary,
|
|
kind: $this->kind,
|
|
badge: $this->badge,
|
|
meta: $this->meta,
|
|
url: $this->url,
|
|
public: $this->public,
|
|
notice: $this->notice,
|
|
visual: $this->visual,
|
|
visualLabel: $this->visualLabel,
|
|
previewImage: $this->previewImage,
|
|
missing: $this->missing,
|
|
style: $this->style,
|
|
);
|
|
}
|
|
}
|