sigd/app/Enums/LandCategory.php

38 lines
1.0 KiB
PHP

<?php
namespace App\Enums;
enum LandCategory: string
{
case FOREST = 'f';
case CROPLAND = 'c';
case GRASSLAND = 'g';
case WETLAND = 'w';
case SETTLEMENT = 's';
case OTHERLAND = 'o';
public static function getName(LandCategory $category): string
{
return match ($category) {
self::FOREST => 'Forest',
self::CROPLAND => 'Cropland',
self::GRASSLAND => 'Grassland',
self::WETLAND => 'Wetland',
self::SETTLEMENT => 'Settlement',
self::OTHERLAND => 'Otherland',
};
}
public static function getSubcategories(LandCategory $category): array
{
return match ($category) {
self::FOREST => ['hp', 'hs', 'hmp', 'hrp', 'ht', 'hms', 'hrs'],
self::CROPLAND => ['pk', 'pt', 'pc', 'sw', 'tr'],
self::GRASSLAND => ['b', 's', 'br'],
self::WETLAND => ['a', 'rw'],
self::SETTLEMENT => ['pm'],
self::OTHERLAND => ['t', 'aw', 'tm', 'bdr', 'tb'],
};
}
}