Files
laraundfelix/app/Domain/Catalog/CompositionKind.php
T
LarsandCursor 3ee9f529ca
Deploy Test / test (push) Successful in 13s
Deploy Test / deploy (push) Successful in 23s
Mache Medien, Übungen und Kurse in der Verwaltung bearbeitbar.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-15 10:49:35 +01:00

61 lines
1.6 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.',
};
}
/**
* @return array<string, string>
*/
public static function options(): array
{
$options = [];
foreach (self::cases() as $case) {
$options[$case->value] = $case->label();
}
return $options;
}
}