public function getParents()
 {
     $parents = array();
     $wmsId = wms::getWmsIdByLayerId($this->layer_uid);
     $wmsFactory = new UniversalWmsFactory();
     $wms = $wmsFactory->createFromDb($wmsId);
     if (!is_null($wms)) {
         try {
             $currentLayer = $wms->getLayerById($this->layer_uid);
         } catch (Exception $e) {
             return $parents;
         }
         while (!is_null($currentLayer)) {
             $pos = $currentLayer->layer_parent;
             $currentLayer = $wms->getLayerByPos($pos);
             if (!is_null($currentLayer)) {
                 $parents[] = $currentLayer;
             }
         }
     }
     return $parents;
 }
        if ($singleAssocArray['zoom']) {
            $options['zoom'] = $singleAssocArray['zoom'] === "1" ? true : false;
        }
        $wmcGetApi->mergeWmsArray($wmsArray, $options);
        $wmsArray = array();
        $singleAssocArray = array();
    }
}
//
// LAYER
//
$inputLayerArray = $getApi->getLayers();
if ($inputLayerArray) {
    foreach ($inputLayerArray as $input) {
        // just make it work for a single layer id
        $wmsFactory = new UniversalWmsFactory();
        try {
            if (isset($input["application"])) {
                $wms = $wmsFactory->createLayerFromDb($input["id"], $input["application"]);
            } else {
                $wms = $wmsFactory->createLayerFromDb($input["id"]);
            }
        } catch (AccessDeniedException $e) {
            $resultObj["noPermission"]["wms"][] = array("title" => $admin->getLayerTitleByLayerId($input["id"]), "id" => $input["id"]);
        }
        if (is_a($wms, "wms")) {
            $options = array();
            if ($input["visible"]) {
                // this is a hack for the time being:
                // make WMS visible if it has less than 100000 layers
                $options["show"] = 100000;