protected function saveThemeStructure(ThemeInterface $theme, $themeStructureFile)
    {
        $templates = array();
        foreach ($this->languagesRepository->activeLanguages() as $language) {
            foreach ($this->pagesRepository->activePages() as $page) {
                $key = $language->getId() . '-' . $page->getId();
                $templates[$key] = $page->getTemplateName();
            }
        }

        $themeName = $theme->getThemeName();
        $currentTheme = array(
            "Theme" => $themeName,
            "Templates" => $templates,
        );

        file_put_contents($themeStructureFile, json_encode($currentTheme));
    }
protected function saveThemeStructure(ThemeInterface $theme, $themeStructureFile)
    {
        $templates = array();
        foreach ($this->languagesRepository->activeLanguages() as $language) {
            foreach ($this->pagesRepository->activePages() as $page) {
                $key = $language->getId() . '-' . $page->getId();
                $templates[$key] = $page->getTemplateName();
            }
        }

        $themeName = $theme->getThemeName();
        $currentTheme = array(
            "Theme" => $themeName,
            "Templates" => $templates,
        );

        file_put_contents($themeStructureFile, json_encode($currentTheme));
    }
protected function saveThemeStructure ( ThemeInterface $ theme , $ themeStructureFile ) { $ templates = array ( ) ; foreach ( $ this -> languagesRepository -> activeLanguages ( ) as $ language ) { foreach ( $ this -> pagesRepository -> activePages ( ) as $ page ) { $ key = $ language -> getId ( ) . '-' . $ page -> getId ( ) ; $ templates [ $ key ] = $ page -> getTemplateName ( ) ; } } $ themeName = $ theme -> getThemeName ( ) ; $ currentTheme = array ( "Theme" => $ themeName , "Templates" => $ templates , ) ; file_put_contents ( $ themeStructureFile , json_encode ( $ currentTheme ) ) ; }
Saves the current theme structure into a file

@param  ThemeInterface $theme
@param  string           $themeStructureFile
@throws \Exception
Saves the current theme structure into a file