WorkerStatuses.php
904 Bytes
<?php
namespace App\Enums;
use App\Enums\EnumTraits\EnumToArray;
enum WorkerStatuses: int
{
use EnumToArray;
case NotIndicated = 1;
case LookingForWork = 0;
case NotLookingForWork = 2;
case ConsideringOffers = 3;
public function label(): string
{
return match($this)
{
self::LookingForWork => 'Ищу работу',
self::NotIndicated => 'Не указано',
self::NotLookingForWork => 'Не ищу работу',
self::ConsideringOffers => 'Рассматриваю предложения',
};
}
public static function getWorkerStatuses(): array {
$statuses_names = self::names();
$result = [];
foreach ($statuses_names as $status_name){
$result[self::{$status_name}->value] = self::{$status_name}->label();
}
return $result;
}
}