original_string: public static function form_policydoc_update_overwrite(stdClass $form) {
  
          $form = clone($form);
          unset($form->timecreated);
  
          $summaryfieldoptions = static::policy_summary_field_options();
          $form = file_postupdate_standard_editor($form, 'summary', $summaryfieldoptions, $summaryfieldoptions['context'],
              'tool_policy', 'policydocumentsummary', $form->id);
          unset($form->summary_editor);
          unset($form->summarytrust);
  
          $contentfieldoptions = static::policy_content_field_options();
          $form = file_postupdate_standard_editor($form, 'content', $contentfieldoptions, $contentfieldoptions['context'],
              'tool_policy', 'policydocumentcontent', $form->id);
          unset($form->content_editor);
          unset($form->contenttrust);
  
          unset($form->status);
          unset($form->save);
          unset($form->saveasdraft);
          unset($form->minorchange);
  
          $policyversion = new policy_version($form->id, $form);
          $policyversion->update();
  
          return $policyversion;
      }
code: public static function form_policydoc_update_overwrite(stdClass $form) {
  
          $form = clone($form);
          unset($form->timecreated);
  
          $summaryfieldoptions = static::policy_summary_field_options();
          $form = file_postupdate_standard_editor($form, 'summary', $summaryfieldoptions, $summaryfieldoptions['context'],
              'tool_policy', 'policydocumentsummary', $form->id);
          unset($form->summary_editor);
          unset($form->summarytrust);
  
          $contentfieldoptions = static::policy_content_field_options();
          $form = file_postupdate_standard_editor($form, 'content', $contentfieldoptions, $contentfieldoptions['context'],
              'tool_policy', 'policydocumentcontent', $form->id);
          unset($form->content_editor);
          unset($form->contenttrust);
  
          unset($form->status);
          unset($form->save);
          unset($form->saveasdraft);
          unset($form->minorchange);
  
          $policyversion = new policy_version($form->id, $form);
          $policyversion->update();
  
          return $policyversion;
      }
code_tokens: public static function form_policydoc_update_overwrite ( stdClass $ form ) { $ form = clone ( $ form ) ; unset ( $ form -> timecreated ) ; $ summaryfieldoptions = static :: policy_summary_field_options ( ) ; $ form = file_postupdate_standard_editor ( $ form , 'summary' , $ summaryfieldoptions , $ summaryfieldoptions [ 'context' ] , 'tool_policy' , 'policydocumentsummary' , $ form -> id ) ; unset ( $ form -> summary_editor ) ; unset ( $ form -> summarytrust ) ; $ contentfieldoptions = static :: policy_content_field_options ( ) ; $ form = file_postupdate_standard_editor ( $ form , 'content' , $ contentfieldoptions , $ contentfieldoptions [ 'context' ] , 'tool_policy' , 'policydocumentcontent' , $ form -> id ) ; unset ( $ form -> content_editor ) ; unset ( $ form -> contenttrust ) ; unset ( $ form -> status ) ; unset ( $ form -> save ) ; unset ( $ form -> saveasdraft ) ; unset ( $ form -> minorchange ) ; $ policyversion = new policy_version ( $ form -> id , $ form ) ; $ policyversion -> update ( ) ; return $ policyversion ; }
docstring: Save the data from the policydoc form, overwriting the existing policy document version.
  
  @param stdClass $form data submitted from the {@link \tool_policy\form\policydoc} form.
  @return \tool_policy\policy_version persistent
docstring_tokens: Save the data from the policydoc form overwriting the existing policy document version .