Example #1
0
 public function getLayerIdByViewId($id)
 {
     $globaluser = Session::getActiveUserIsGlobal();
     $Stores = Session::getActiveStoreData();
     if ($globaluser == 1) {
         return 0;
     }
     if ($id == 0) {
         if (isset($Stores['global'])) {
             return 0;
         } else {
             // throw new Exception('No privileges '.$id);
         }
     }
     foreach ($Stores as $key => $store) {
         if ($key != 'global') {
             foreach ($store as $storeKey => $view) {
                 if ($id == $view) {
                     return $key;
                 }
             }
         }
     }
     // throw new Exception('No privileges '.$id);
 }