original_string: public static function read_template($id) {
          static::require_enabled();
          $template = new template($id);
          $context = $template->get_context();
  
          // First we do a permissions check.
          if (!$template->can_read()) {
               throw new required_capability_exception($template->get_context(), 'moodle/competency:templateview',
                  'nopermissions', '');
          }
  
          // OK - all set.
          return $template;
      }
code: public static function read_template($id) {
          static::require_enabled();
          $template = new template($id);
          $context = $template->get_context();
  
          // First we do a permissions check.
          if (!$template->can_read()) {
               throw new required_capability_exception($template->get_context(), 'moodle/competency:templateview',
                  'nopermissions', '');
          }
  
          // OK - all set.
          return $template;
      }
code_tokens: public static function read_template ( $ id ) { static :: require_enabled ( ) ; $ template = new template ( $ id ) ; $ context = $ template -> get_context ( ) ; // First we do a permissions check. if ( ! $ template -> can_read ( ) ) { throw new required_capability_exception ( $ template -> get_context ( ) , 'moodle/competency:templateview' , 'nopermissions' , '' ) ; } // OK - all set. return $ template ; }
docstring: Read a the details for a single learning plan template and return a record.
  
  Requires moodle/competency:templateview capability at the system context.
  
  @param int $id The id of the template to read.
  @return template
docstring_tokens: Read a the details for a single learning plan template and return a record .