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;
    }
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;
    }
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 ; }
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
Read a the details for a single learning plan template and return a record .