original_string: public static function delete_evidence($evidenceorid) {
          $evidence = $evidenceorid;
          if (!is_object($evidence)) {
              $evidence = new evidence($evidenceorid);
          }
  
          $uc = new user_competency($evidence->get('usercompetencyid'));
          if (!evidence::can_delete_user($uc->get('userid'))) {
              throw new required_capability_exception($uc->get_context(), 'moodle/competency:evidencedelete', 'nopermissions', '');
          }
  
          return $evidence->delete();
      }
code: public static function delete_evidence($evidenceorid) {
          $evidence = $evidenceorid;
          if (!is_object($evidence)) {
              $evidence = new evidence($evidenceorid);
          }
  
          $uc = new user_competency($evidence->get('usercompetencyid'));
          if (!evidence::can_delete_user($uc->get('userid'))) {
              throw new required_capability_exception($uc->get_context(), 'moodle/competency:evidencedelete', 'nopermissions', '');
          }
  
          return $evidence->delete();
      }
code_tokens: public static function delete_evidence ( $ evidenceorid ) { $ evidence = $ evidenceorid ; if ( ! is_object ( $ evidence ) ) { $ evidence = new evidence ( $ evidenceorid ) ; } $ uc = new user_competency ( $ evidence -> get ( 'usercompetencyid' ) ) ; if ( ! evidence :: can_delete_user ( $ uc -> get ( 'userid' ) ) ) { throw new required_capability_exception ( $ uc -> get_context ( ) , 'moodle/competency:evidencedelete' , 'nopermissions' , '' ) ; } return $ evidence -> delete ( ) ; }
docstring: Delete an evidence.
  
  @param evidence|int $evidenceorid The evidence, or its ID.
  @return bool
docstring_tokens: Delete an evidence .