Helper/Form/Post/Storeview.php
protected function getTree($storeIds)
    {
        $filter = implode(',', $storeIds);
        if (isset($this->storeTrees[$filter])) {
            return $this->storeTrees[$filter];
        }

        $data = [];
        $stores = $this->storeManager->getStores(true);
        foreach ($stores as $store) {
            if (in_array($store->getId(), $storeIds)) {
                $data[$store->getId()] = $this->getStoreOptions($store);
            } elseif ($filter == 0) {
                $data[$store->getId()] = $this->getStoreOptions($store);
            }
        }

        $this->storeTrees[$filter] = $data;

        return $this->storeTrees[$filter];
    }
protected function getTree($storeIds)
    {
        $filter = implode(',', $storeIds);
        if (isset($this->storeTrees[$filter])) {
            return $this->storeTrees[$filter];
        }

        $data = [];
        $stores = $this->storeManager->getStores(true);
        foreach ($stores as $store) {
            if (in_array($store->getId(), $storeIds)) {
                $data[$store->getId()] = $this->getStoreOptions($store);
            } elseif ($filter == 0) {
                $data[$store->getId()] = $this->getStoreOptions($store);
            }
        }

        $this->storeTrees[$filter] = $data;

        return $this->storeTrees[$filter];
    }
protected function getTree ( $ storeIds ) { $ filter = implode ( ',' , $ storeIds ) ; if ( isset ( $ this -> storeTrees [ $ filter ] ) ) { return $ this -> storeTrees [ $ filter ] ; } $ data = [ ] ; $ stores = $ this -> storeManager -> getStores ( true ) ; foreach ( $ stores as $ store ) { if ( in_array ( $ store -> getId ( ) , $ storeIds ) ) { $ data [ $ store -> getId ( ) ] = $ this -> getStoreOptions ( $ store ) ; } elseif ( $ filter == 0 ) { $ data [ $ store -> getId ( ) ] = $ this -> getStoreOptions ( $ store ) ; } } $ this -> storeTrees [ $ filter ] = $ data ; return $ this -> storeTrees [ $ filter ] ; }
Retrieve store tree

@param array $storeIds
@return array
Retrieve store tree