]> _ Git - cubedesigners_userdatabase.git/commitdiff
wip #6744 @0.5 backpack6
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 23 Feb 2024 11:29:34 +0000 (12:29 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 23 Feb 2024 11:29:34 +0000 (12:29 +0100)
src/app/Permissions.php

index f3fc7c0c0989b48ecc483dc441ce4e2a8b07b21f..a665bea87dab9c2633b8e338036ad8e5ce054272 100644 (file)
@@ -128,6 +128,22 @@ class Permissions
         return self::$_data;
     }
 
+    public static function getAllInvoicableCompanies()
+    {
+        $data = self::_getData();
+        $res = [];
+        foreach ($data['invoicableCompany'] as $id => $invoicable) {
+            if ($id !== $invoicable) {
+                continue;
+            }
+            if (!isset($data['companyNames'][$id])) {
+                continue;
+            }
+            $res[$id] = $data['companyNames'][$id];
+        }
+        return $res;
+    }
+
     /**
      * @param integer $company
      * @return array