original_string: public static function list_competencies_in_template($templateorid) {
          static::require_enabled();
          // First we do a permissions check.
          $template = $templateorid;
          if (!is_object($template)) {
              $template = new template($template);
          }
  
          if (!$template->can_read()) {
              throw new required_capability_exception($template->get_context(), 'moodle/competency:templateview',
                  'nopermissions', '');
          }
  
          // OK - all set.
          return template_competency::list_competencies($template->get('id'));
      }
code: public static function list_competencies_in_template($templateorid) {
          static::require_enabled();
          // First we do a permissions check.
          $template = $templateorid;
          if (!is_object($template)) {
              $template = new template($template);
          }
  
          if (!$template->can_read()) {
              throw new required_capability_exception($template->get_context(), 'moodle/competency:templateview',
                  'nopermissions', '');
          }
  
          // OK - all set.
          return template_competency::list_competencies($template->get('id'));
      }
code_tokens: public static function list_competencies_in_template ( $ templateorid ) { static :: require_enabled ( ) ; // First we do a permissions check. $ template = $ templateorid ; if ( ! is_object ( $ template ) ) { $ template = new template ( $ template ) ; } if ( ! $ template -> can_read ( ) ) { throw new required_capability_exception ( $ template -> get_context ( ) , 'moodle/competency:templateview' , 'nopermissions' , '' ) ; } // OK - all set. return template_competency :: list_competencies ( $ template -> get ( 'id' ) ) ; }
docstring: List all the competencies in a template.
  
  @param  template|int $templateorid The template or its ID.
  @return array of competencies
docstring_tokens: List all the competencies in a template .