ldc-supportweb/app/Enums/TicketStatus.php
2023-04-06 08:54:23 +00:00

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 waiting()
* @method static self waitingValidation()
* @method static self recette()
* @method static self production()
* @method static self archived()
* @method static self takenInAccount()
*/
class TicketStatus extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
'new' => 1,
'estimateTodo' => 2,
'waiting' => 9,
'recette' => 12,
'production' => 13,
'archived' => 15,
'waitingValidation' => 17,
'takenInAccount' => 18,
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [
'new' => trans('Nouveau'),
'estimateTodo' => trans('Devis à faire'),
'waiting' => trans('En attente de réponse'),
'waitingValidation' => trans('En attente de validation'),
'recette' => trans('En recettage'),
'production' => trans('En production'),
'archived' => trans('Archivé'),
'takenInAccount' => trans('Pris en compte'),
];
}
/**
* Enum classes
*
* @return array
*/
protected static function classes(): array
{
return [
'new' => 'text-danger',
'estimateTodo' => 'text-info',
'waiting' => 'text-white bg-danger',
'waitingValidation' => 'text-warning bg-danger',
'recette' => 'text-primary',
'production' => 'text-success',
'archived' => 'text-secondary',
'takenInAccount' => 'text-info',
];
}
/**
* @param string $attribute
* @return integer|string
*/
public function __get(string $attribute)
{
if ($attribute === 'class') {
return $this->classes()[$this->getDefinition()];
}
return parent::__get($attribute);
}
}