public static function competency_viewed($competencyorid) {
        static::require_enabled();
        $competency = $competencyorid;
        if (!is_object($competency)) {
            $competency = new competency($competency);
        }

        if (!has_any_capability(array('moodle/competency:competencyview', 'moodle/competency:competencymanage'),
                $competency->get_context())) {
            throw new required_capability_exception($competency->get_context(), 'moodle/competency:competencyview',
                'nopermissions', '');
        }

        \core\event\competency_viewed::create_from_competency($competency)->trigger();
        return true;
    }
public static function competency_viewed($competencyorid) {
        static::require_enabled();
        $competency = $competencyorid;
        if (!is_object($competency)) {
            $competency = new competency($competency);
        }

        if (!has_any_capability(array('moodle/competency:competencyview', 'moodle/competency:competencymanage'),
                $competency->get_context())) {
            throw new required_capability_exception($competency->get_context(), 'moodle/competency:competencyview',
                'nopermissions', '');
        }

        \core\event\competency_viewed::create_from_competency($competency)->trigger();
        return true;
    }
public static function competency_viewed ( $ competencyorid ) { static :: require_enabled ( ) ; $ competency = $ competencyorid ; if ( ! is_object ( $ competency ) ) { $ competency = new competency ( $ competency ) ; } if ( ! has_any_capability ( array ( 'moodle/competency:competencyview' , 'moodle/competency:competencymanage' ) , $ competency -> get_context ( ) ) ) { throw new required_capability_exception ( $ competency -> get_context ( ) , 'moodle/competency:competencyview' , 'nopermissions' , '' ) ; } \ core \ event \ competency_viewed :: create_from_competency ( $ competency ) -> trigger ( ) ; return true ; }
Logg the competency viewed event.

@param competency|int $competencyorid The competency object or competency id
@return bool
Logg the competency viewed event .