Files
laraundfelix/app/Domain/Catalog/Composition.php
T
LarsandClaude Sonnet 5.5 765b8e779e
Deploy Test / test (push) Successful in 3m21s
Deploy Test / deploy (push) Successful in 27s
Führe PDF-Vorlagen für Dokumente ein: Titelseite, grafischer Kopf und Fuß, Angaben je Fassung (ADR-51, Nachtrag)
Eine Vorlage ist reines Layout (Titelseite mit allein stehendem Titel, Kopf- und Fußgrafik aus dem Medienbestand,
Herausgeber und Standardvermerk) und wird dem Dokument zugeordnet. Untertitel, Ausgabe, Veröffentlichungsdatum und
Copyright-Vermerk gehören zur Dokumentfassung (document_meta). Ohne Vorlage bleibt das PDF unverändert.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 14:28:34 +01:00

70 lines
1.8 KiB
PHP

<?php
namespace App\Domain\Catalog;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Composition extends Model
{
protected $fillable = [
'designation',
'display_title',
'teaser',
'summary',
'description',
'search_terms',
'thumbnail_path',
'thumbnail_alt',
'thumbnail_source',
'thumbnail_error',
'public_slug',
'kind',
'editorial_content_kind_id',
'archived_at',
'working_draft',
'pdf_template_id',
];
protected function casts(): array
{
return [
'kind' => CompositionKind::class,
'archived_at' => 'datetime',
'working_draft' => 'array',
];
}
protected static function booted(): void
{
static::addGlobalScope(new SupportedKindScope);
}
public function editorialContentKind(): BelongsTo
{
return $this->belongsTo(EditorialContentKind::class);
}
/** Die PDF-Vorlage eines Dokuments; leer = bisheriges Layout (ADR-51). */
public function pdfTemplate(): BelongsTo
{
return $this->belongsTo(PdfTemplate::class);
}
public function versions(): HasMany
{
return $this->hasMany(CompositionVersion::class);
}
/**
* Direkt zugeordnete fachliche Säulen (zentrale Säulenverwaltung). Die Säulen der enthaltenen Medien sind davon
* getrennt und werden zur Laufzeit abgeleitet (CatalogReading::memberPillars).
*/
public function pillars(): BelongsToMany
{
return $this->belongsToMany(Pillar::class)->orderBy('pillars.sort_order')->orderBy('pillars.name');
}
}