original_string: public static function competency_framework_viewed($frameworkorid) {
          static::require_enabled();
          $framework = $frameworkorid;
          if (!is_object($framework)) {
              $framework = new competency_framework($framework);
          }
          if (!has_any_capability(array('moodle/competency:competencyview', 'moodle/competency:competencymanage'),
                  $framework->get_context())) {
              throw new required_capability_exception($framework->get_context(), 'moodle/competency:competencyview',
                  'nopermissions', '');
          }
          \core\event\competency_framework_viewed::create_from_framework($framework)->trigger();
          return true;
      }
code: public static function competency_framework_viewed($frameworkorid) {
          static::require_enabled();
          $framework = $frameworkorid;
          if (!is_object($framework)) {
              $framework = new competency_framework($framework);
          }
          if (!has_any_capability(array('moodle/competency:competencyview', 'moodle/competency:competencymanage'),
                  $framework->get_context())) {
              throw new required_capability_exception($framework->get_context(), 'moodle/competency:competencyview',
                  'nopermissions', '');
          }
          \core\event\competency_framework_viewed::create_from_framework($framework)->trigger();
          return true;
      }
code_tokens: public static function competency_framework_viewed ( $ frameworkorid ) { static :: require_enabled ( ) ; $ framework = $ frameworkorid ; if ( ! is_object ( $ framework ) ) { $ framework = new competency_framework ( $ framework ) ; } if ( ! has_any_capability ( array ( 'moodle/competency:competencyview' , 'moodle/competency:competencymanage' ) , $ framework -> get_context ( ) ) ) { throw new required_capability_exception ( $ framework -> get_context ( ) , 'moodle/competency:competencyview' , 'nopermissions' , '' ) ; } \ core \ event \ competency_framework_viewed :: create_from_framework ( $ framework ) -> trigger ( ) ; return true ; }
docstring: Logg the competency framework viewed event.
  
  @param competency_framework|int $frameworkorid The competency_framework object or competency framework id
  @return bool
docstring_tokens: Logg the competency framework viewed event .