Classes/Services/LayerService.php
private function setChildHide($childList, $parentLayer)
    {
        $newChildList = [];
        if ($childList && $parentLayer) {
            foreach($childList as $index=>$child)
            {
                if ($parentLayer->data_hidelayer) {
                    $child['hide'] = $parentLayer->data_hidelayer;
                    if ($child['hasChilds']) {
                        $child['childs'] = $this->setChildHide($child['childs'], $parentLayer);
                    }
                }
                $newChildList[$index] = $child;
            }
        }
        return $newChildList;
    }
private function setChildHide($childList, $parentLayer)
    {
        $newChildList = [];
        if ($childList && $parentLayer) {
            foreach($childList as $index=>$child)
            {
                if ($parentLayer->data_hidelayer) {
                    $child['hide'] = $parentLayer->data_hidelayer;
                    if ($child['hasChilds']) {
                        $child['childs'] = $this->setChildHide($child['childs'], $parentLayer);
                    }
                }
                $newChildList[$index] = $child;
            }
        }
        return $newChildList;
    }
private function setChildHide ( $ childList , $ parentLayer ) { $ newChildList = [ ] ; if ( $ childList && $ parentLayer ) { foreach ( $ childList as $ index => $ child ) { if ( $ parentLayer -> data_hidelayer ) { $ child [ 'hide' ] = $ parentLayer -> data_hidelayer ; if ( $ child [ 'hasChilds' ] ) { $ child [ 'childs' ] = $ this -> setChildHide ( $ child [ 'childs' ] , $ parentLayer ) ; } } $ newChildList [ $ index ] = $ child ; } } return $ newChildList ; }
Private function to set the hide property of childs correctly.
@param $childList
@param $parentLayer
@return array
Private function to set the hide property of childs correctly .