87 lines
2.1 KiB
PHP
87 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
|
|
|
/**
|
|
* @method static self new()
|
|
* @method static self estimateTodo()
|
|
* @method static self takenInAccount()
|
|
* @method static self waiting()
|
|
* @method static self waitingValidation()
|
|
* @method static self recette()
|
|
* @method static self production()
|
|
* @method static self archived()
|
|
*/
|
|
class TicketStatus extends BaseEnumRoutable
|
|
{
|
|
/**
|
|
* Enum values
|
|
*
|
|
* @return array
|
|
*/
|
|
protected static function values(): array
|
|
{
|
|
return [
|
|
'new' => 1,
|
|
'estimateTodo' => 2,
|
|
'takenInAccount' => 3,
|
|
'waiting' => 4,
|
|
'waitingValidation' => 5,
|
|
'recette' => 6,
|
|
'production' => 7,
|
|
'archived' => 8,
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Enum labels
|
|
*
|
|
* @return array
|
|
*/
|
|
protected static function labels(): array
|
|
{
|
|
return [
|
|
'new' => trans('Nouveau'),
|
|
'estimateTodo' => trans('Devis à faire'),
|
|
'takenInAccount' => trans('Pris en compte'),
|
|
'waiting' => trans('En attente de réponse'),
|
|
'waitingValidation' => trans('En attente de validation'),
|
|
'recette' => trans('En recettage'),
|
|
'production' => trans('En production'),
|
|
'archived' => trans('Archivé'),
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Enum classes
|
|
*
|
|
* @return array
|
|
*/
|
|
protected static function classes(): array
|
|
{
|
|
return [
|
|
'new' => 'text-danger',
|
|
'estimateTodo' => 'text-info',
|
|
'takenInAccount' => 'text-info',
|
|
'waiting' => 'text-white bg-danger',
|
|
'waitingValidation' => 'text-warning bg-danger',
|
|
'recette' => 'text-primary',
|
|
'production' => 'text-success',
|
|
'archived' => 'text-secondary',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @param string $attribute
|
|
* @return integer|string
|
|
*/
|
|
public function __get(string $attribute)
|
|
{
|
|
if ($attribute === 'class') {
|
|
return $this->classes()[$this->getDefinition()];
|
|
}
|
|
return parent::__get($attribute);
|
|
}
|
|
}
|