ldc-startcoq/app/Enums/Products/ProductCertificationEnum.php
Alexis Gousseau 95c9dd10d5 add enums
2023-02-23 10:26:11 +01:00

28 lines
707 B
PHP

<?php
namespace App\Enums\Products;
enum ProductCertificationEnum : int {
case bioAB = 1;
case labelRouge = 2;
case certifiedCQ = 3;
case standard = 4;
case freeRange = 5;
case others = 6;
public function label(): string {
return static::getLabel($this);
}
public static function getLabel(self $value): string {
return match ($value) {
self::bioAB => __('Bio AB ou Européen'),
self::labelRouge => __('Label Rouge'),
self::certifiedCQ => __('Certifié CQ'),
self::standard => __('Standard'),
self::freeRange => __('Free Range'),
self::others => __('Autres'),
};
}
}