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();
    }
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();
    }
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 ( ) ; }
Delete an evidence.

@param evidence|int $evidenceorid The evidence, or its ID.
@return bool
Delete an evidence .