original_string: public static function clean_up_non_existing_area($areaid) {
          global $DB;
  
          if (!empty(self::get_search_area($areaid))) {
              throw new \coding_exception("Area $areaid exists. Please use appropriate search area class to manipulate the data.");
          }
  
          $parts = self::parse_areaid($areaid);
  
          $plugin = $parts[0];
          $configprefix = $parts[1];
  
          foreach (base::get_settingnames() as $settingname) {
              $name = $configprefix. $settingname;
              $DB->delete_records('config_plugins', ['name' => $name, 'plugin' => $plugin]);
          }
  
          $engine = self::instance()->get_engine();
          $engine->delete($areaid);
      }
code: public static function clean_up_non_existing_area($areaid) {
          global $DB;
  
          if (!empty(self::get_search_area($areaid))) {
              throw new \coding_exception("Area $areaid exists. Please use appropriate search area class to manipulate the data.");
          }
  
          $parts = self::parse_areaid($areaid);
  
          $plugin = $parts[0];
          $configprefix = $parts[1];
  
          foreach (base::get_settingnames() as $settingname) {
              $name = $configprefix. $settingname;
              $DB->delete_records('config_plugins', ['name' => $name, 'plugin' => $plugin]);
          }
  
          $engine = self::instance()->get_engine();
          $engine->delete($areaid);
      }
code_tokens: public static function clean_up_non_existing_area ( $ areaid ) { global $ DB ; if ( ! empty ( self :: get_search_area ( $ areaid ) ) ) { throw new \ coding_exception ( "Area $areaid exists. Please use appropriate search area class to manipulate the data." ) ; } $ parts = self :: parse_areaid ( $ areaid ) ; $ plugin = $ parts [ 0 ] ; $ configprefix = $ parts [ 1 ] ; foreach ( base :: get_settingnames ( ) as $ settingname ) { $ name = $ configprefix . $ settingname ; $ DB -> delete_records ( 'config_plugins' , [ 'name' => $ name , 'plugin' => $ plugin ] ) ; } $ engine = self :: instance ( ) -> get_engine ( ) ; $ engine -> delete ( $ areaid ) ; }
docstring: Cleans up non existing search area.
  
  1. Remove all configs from {config_plugins} table.
  2. Delete all related indexed documents.
  
  @param string $areaid Search area id.
docstring_tokens: Cleans up non existing search area .