Ergänze die gemeinsame redaktionelle Basis an den Fachobjekten.
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>
This commit is contained in:
1 parent
c4be6ed8dc
commit
f29ea58fd5
40 files changed
+2311
-20
No files matched your search
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Catalog;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Aufgelöste Klasse-A-Angaben eines Fachobjekts.
|
||||
* Fehlende Felder bleiben leer. Es wird nichts materialisiert.
|
||||
*/
|
||||
final readonly class EditorialProfile
|
||||
{
|
||||
/**
|
||||
* @param array<string, ResolvedText> $texts
|
||||
*/
|
||||
public function __construct(
|
||||
public ?string $workingTitle,
|
||||
public array $texts,
|
||||
public ?string $searchTerms,
|
||||
public string $searchOrigin,
|
||||
public ?string $kindLabel,
|
||||
public ?Model $source,
|
||||
) {}
|
||||
|
||||
public function text(string $field): ResolvedText
|
||||
{
|
||||
return $this->texts[$field] ?? new ResolvedText(null, 'leer', null);
|
||||
}
|
||||
|
||||
public function value(string $field): ?string
|
||||
{
|
||||
return $this->text($field)->value;
|
||||
}
|
||||
|
||||
public function origin(string $field): string
|
||||
{
|
||||
return $this->text($field)->origin;
|
||||
}
|
||||
|
||||
public function originLabel(string $field): string
|
||||
{
|
||||
$text = $this->text($field);
|
||||
|
||||
return match ($text->origin) {
|
||||
'eigen' => 'Eigene Angabe',
|
||||
'variante' => 'Abweichung für '.($text->label ?? 'diesen Kontext'),
|
||||
'quelle' => 'Übernommen von '.($text->label ?? 'der fachlichen Quelle'),
|
||||
default => 'Keine Angabe',
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user