ldc-lionor/app/Enums/CookingModeEnum.php
Sebastien Hattry 2a8c966892 Intergration 4
2023-03-20 13:17:58 +00:00

76 lines
1.7 KiB
PHP

<?php
namespace App\Enums;
use Kwaadpepper\Enum\BaseEnum;
/**
* @method static self withoutCooking()
* Sans cuisson
* @method static self oven()
* Au four
* @method static self stove()
* A la poele
* @method static self stewpan()
* En cocotte
*/
final class CookingModeEnum extends BaseEnum
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
'withoutCooking' => 0,
'oven' => 1,
'stove' => 2,
'stewpan' => 3
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [
'withoutCooking' => trans('Sans cuisson'),
'oven' => trans('Au four'),
'stove' => trans('A la poële'),
'stewpan' => trans('En cocotte'),
];
}
/**
* Enum stickers associés
*
* @return array
*/
protected static function stickers(): array
{
return [
'all' => \asset('build/assets/images/cook/logo-stove.svg'),
'withoutCooking' => \asset('build/assets/images/cook/logo-stove.svg'),
'oven' => \asset('build/assets/images/cook/logo-stove.svg'),
'stove' => \asset('build/assets/images/cook/logo-stove.svg'),
'stewpan' => \asset('build/assets/images/cook/logo-stove.svg'),
];
}
/**
* @param string $attribute
* @return integer|string
*/
public function __get(string $attribute)
{
if ($attribute === 'sticker') {
return $this->stickers()[$this->getDefinition()] ?? null;
}
return parent::__get($attribute);
}
}