Files
laraundfelix/app/Domain/Catalog/CompositionKind.php
LarsandCursor c997eb500c
Deploy Test / test (push) Successful in 2m28s
Deploy Test / deploy (push) Failing after 14s
Leite Vorschaubilder und Filmstufen geschuetzt ab
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-16 09:40:59 +01:00

93 lines
2.5 KiB
PHP

<?php
namespace App\Domain\Catalog;
enum CompositionKind: string
{
case Kombination = 'kombination';
case Uebung = 'uebung';
case Kurs = 'kurs';
public function label(): string
{
return match ($this) {
self::Kombination => 'Fachliche Kombination',
self::Uebung => 'Übung',
self::Kurs => 'Kurs',
};
}
public function plural(): string
{
return match ($this) {
self::Kombination => 'Fachliche Kombinationen',
self::Uebung => 'Übungen',
self::Kurs => 'Kurse',
};
}
public function createLabel(): string
{
return match ($this) {
self::Kombination => 'Kombination anlegen',
self::Uebung => 'Übung anlegen',
self::Kurs => 'Kurs anlegen',
};
}
public function explanation(): string
{
return match ($this) {
self::Kombination => 'Didaktische oder thematische Zusammenstellung, zum Beispiel ein Materialsatz. Sie wird in Übungen und Kursen wiederverwendet und ist selbst kein Kurs.',
self::Uebung => 'Eine konkrete Lernsituation, zum Beispiel aus Film und Merkblatt. Dieselben Medien können in mehreren Übungen stecken.',
self::Kurs => 'Ein Ablauf für den Kursbetrieb aus Übungen, Kombinationen und Medien. Ein Kurs ist keine Übung.',
};
}
public function deskLabel(): string
{
return match ($this) {
self::Kombination => 'Fachliche Kombination',
self::Uebung => 'Modul',
self::Kurs => 'Programm',
};
}
public function deskExplanation(): string
{
return match ($this) {
self::Kombination => $this->explanation(),
self::Uebung => 'Ein Modul mit Lernziel, Zeit, Material und geordneten Bestandteilen. Dieselben Medien können in mehreren Modulen stecken.',
self::Kurs => 'Ein Programm aus Modulen und weiteren Inhalten.',
};
}
/**
* @return array<string, string>
*/
public static function deskOptions(): array
{
$options = [];
foreach (self::cases() as $case) {
$options[$case->value] = $case->deskLabel();
}
return $options;
}
/**
* @return array<string, string>
*/
public static function options(): array
{
$options = [];
foreach (self::cases() as $case) {
$options[$case->value] = $case->label();
}
return $options;
}
}