28 lines
653 B
PHP
28 lines
653 B
PHP
<?php
|
|
|
|
namespace App\Enums\Products;
|
|
|
|
enum ProductGeoAreaEnum : int {
|
|
case french = 1;
|
|
case european = 2;
|
|
case asia = 3;
|
|
case america = 4;
|
|
case africa = 5;
|
|
case oceania = 6;
|
|
|
|
public function label(): string {
|
|
return static::getLabel($this);
|
|
}
|
|
|
|
public static function getLabel(self $value): string {
|
|
return match ($value) {
|
|
self::french => __('France'),
|
|
self::european => __('Europe'),
|
|
self::asia => __('Asie'),
|
|
self::america => __('Amérique'),
|
|
self::africa => __('Afrique'),
|
|
self::oceania => __('Océanie'),
|
|
};
|
|
}
|
|
|
|
}
|