original_string: public function beforeValidate()
      {
          if (!$theme = Theme::getEditTheme()) {
              throw new ApplicationException('Unable to find the active theme.');
          }
  
          $themeMap = $this->getSettingsValue('theme_map', []);
          $themeMap[$theme->getDirName()] = $this->getSettingsValue('cms_page');
          $this->setSettingsValue('theme_map', $themeMap);
      }
code: public function beforeValidate()
      {
          if (!$theme = Theme::getEditTheme()) {
              throw new ApplicationException('Unable to find the active theme.');
          }
  
          $themeMap = $this->getSettingsValue('theme_map', []);
          $themeMap[$theme->getDirName()] = $this->getSettingsValue('cms_page');
          $this->setSettingsValue('theme_map', $themeMap);
      }
code_tokens: public function beforeValidate ( ) { if ( ! $ theme = Theme :: getEditTheme ( ) ) { throw new ApplicationException ( 'Unable to find the active theme.' ) ; } $ themeMap = $ this -> getSettingsValue ( 'theme_map' , [ ] ) ; $ themeMap [ $ theme -> getDirName ( ) ] = $ this -> getSettingsValue ( 'cms_page' ) ; $ this -> setSettingsValue ( 'theme_map' , $ themeMap ) ; }
docstring: Ensure each theme has its own CMS page, store it inside a mapping array.
  @return void
docstring_tokens: Ensure each theme has its own CMS page store it inside a mapping array .