original_string: public static function delete_all_for_context($contextid) {
          global $DB;
  
          $areaids = $DB->get_fieldset_select('grading_areas', 'id', 'contextid = ?', array($contextid));
          $methods = array_keys(self::available_methods(false));
  
          foreach($areaids as $areaid) {
              $manager = get_grading_manager($areaid);
              foreach ($methods as $method) {
                  $controller = $manager->get_controller($method);
                  $controller->delete_definition();
              }
          }
  
          $DB->delete_records_list('grading_areas', 'id', $areaids);
      }
code: public static function delete_all_for_context($contextid) {
          global $DB;
  
          $areaids = $DB->get_fieldset_select('grading_areas', 'id', 'contextid = ?', array($contextid));
          $methods = array_keys(self::available_methods(false));
  
          foreach($areaids as $areaid) {
              $manager = get_grading_manager($areaid);
              foreach ($methods as $method) {
                  $controller = $manager->get_controller($method);
                  $controller->delete_definition();
              }
          }
  
          $DB->delete_records_list('grading_areas', 'id', $areaids);
      }
code_tokens: public static function delete_all_for_context ( $ contextid ) { global $ DB ; $ areaids = $ DB -> get_fieldset_select ( 'grading_areas' , 'id' , 'contextid = ?' , array ( $ contextid ) ) ; $ methods = array_keys ( self :: available_methods ( false ) ) ; foreach ( $ areaids as $ areaid ) { $ manager = get_grading_manager ( $ areaid ) ; foreach ( $ methods as $ method ) { $ controller = $ manager -> get_controller ( $ method ) ; $ controller -> delete_definition ( ) ; } } $ DB -> delete_records_list ( 'grading_areas' , 'id' , $ areaids ) ; }
docstring: Removes all data associated with the given context
  
  This is called by {@link context::delete_content()}
  
  @param int $contextid context id
docstring_tokens: Removes all data associated with the given context