public static function template_viewed($id) {
        $params = self::validate_parameters(self::view_book_parameters(), array(
            'id' => $id
        ));

        $template = api::read_template($params['id']);
        self::validate_context($template->get_context());

        return api::template_viewed($params['id']);
    }
public static function template_viewed($id) {
        $params = self::validate_parameters(self::view_book_parameters(), array(
            'id' => $id
        ));

        $template = api::read_template($params['id']);
        self::validate_context($template->get_context());

        return api::template_viewed($params['id']);
    }
public static function template_viewed ( $ id ) { $ params = self :: validate_parameters ( self :: view_book_parameters ( ) , array ( 'id' => $ id ) ) ; $ template = api :: read_template ( $ params [ 'id' ] ) ; self :: validate_context ( $ template -> get_context ( ) ) ; return api :: template_viewed ( $ params [ 'id' ] ) ; }
Log the template viewed event.

@param int $id the template id
@return array of warnings and status result
@throws moodle_exception
Log the template viewed event .