wngur6076 1 month ago
parent
commit
f716fa9dea
1 changed files with 18 additions and 0 deletions
  1. 18 0
      app/Helpers/DataConverter.php

+ 18 - 0
app/Helpers/DataConverter.php

@@ -189,6 +189,11 @@ class DataConverter
         return self::$codeTitle['ship-type'][$value][$data]['Title'] ?? 'Invalid';
     }
 
+    public static function format_func_body_situation($value, $data)
+    {
+        return self::$codeTitle['body-situation'][$value][$data]['Title'] ?? 'Invalid';
+    }
+
     public static function get_status($value)
     {
         if (isset(self::$codeTitle['status'][$value])) {
@@ -396,4 +401,17 @@ class DataConverter
             self::$codeTitle['condition-type'][$value] = null;
         }
     }
+
+    public static function get_body_situation($value)
+    {
+        if (isset(self::$codeTitle['body-situation'][$value])) {
+            return;
+        }
+
+        try {
+            self::$codeTitle['body-situation'][$value] = collect(Utils::getParamFile("/etc/code-title/body-situation/{$value}"))->keyBy('Code')->toArray();
+        } catch (ParameterException $e) {
+            self::$codeTitle['body-situation'][$value] = null;
+        }
+    }
 }