33 lines
669 B
PHP
33 lines
669 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
use App\Traits\Enum\WithComment;
|
|
use App\Traits\Enum\WithValue;
|
|
|
|
enum MediaClassification: int
|
|
{
|
|
use WithComment, WithValue;
|
|
|
|
case LOCAL = 1;
|
|
case REGIONAL = 2;
|
|
case NATIONAL = 3;
|
|
|
|
public function label()
|
|
{
|
|
return match ($this) {
|
|
self::LOCAL => 'Lokal',
|
|
self::REGIONAL => 'Regional',
|
|
self::NATIONAL => 'Nasional',
|
|
};
|
|
}
|
|
|
|
public static function options(): array
|
|
{
|
|
return array_combine(
|
|
array_map(fn ($status) => $status->value, self::cases()),
|
|
array_map(fn ($status) => $status->label(), self::cases())
|
|
);
|
|
}
|
|
}
|