original_string: public static function inactivate($policyid) {
          global $DB;
  
          if ($currentversionid = $DB->get_field('tool_policy', 'currentversionid', ['id' => $policyid])) {
              // Archive the current version.
              $DB->set_field('tool_policy_versions', 'archived', 1, ['id' => $currentversionid]);
              // Unset current version for the policy.
              $DB->set_field('tool_policy', 'currentversionid', null, ['id' => $policyid]);
          }
      }
code: public static function inactivate($policyid) {
          global $DB;
  
          if ($currentversionid = $DB->get_field('tool_policy', 'currentversionid', ['id' => $policyid])) {
              // Archive the current version.
              $DB->set_field('tool_policy_versions', 'archived', 1, ['id' => $currentversionid]);
              // Unset current version for the policy.
              $DB->set_field('tool_policy', 'currentversionid', null, ['id' => $policyid]);
          }
      }
code_tokens: public static function inactivate ( $ policyid ) { global $ DB ; if ( $ currentversionid = $ DB -> get_field ( 'tool_policy' , 'currentversionid' , [ 'id' => $ policyid ] ) ) { // Archive the current version. $ DB -> set_field ( 'tool_policy_versions' , 'archived' , 1 , [ 'id' => $ currentversionid ] ) ; // Unset current version for the policy. $ DB -> set_field ( 'tool_policy' , 'currentversionid' , null , [ 'id' => $ policyid ] ) ; } }
docstring: Inactivate the policy document - no version marked as current and the document does not apply.
  
  @param int $policyid
docstring_tokens: Inactivate the policy document - no version marked as current and the document does not apply .