Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 402] [Versions 311 and 403]

This file contains an abstract definition of an LTI resource

Author: Stephen Vickers
Copyright: 2014 Vital Source Technologies http://vitalsource.com
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 389 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

resource_base:: (16 methods):
  __construct()
  get_id()
  get_template()
  get_path()
  get_type()
  get_service()
  get_methods()
  get_formats()
  get_variables()
  get_endpoint()
  check_tool()
  check_tool_proxy()
  check_type()
  get_permissions()
  parse_value()
  parse_template()


Class: resource_base  - X-Ref

The mod_lti\local\ltiservice\resource_base class.

__construct($service)   X-Ref
Class constructor.

param: service_base $service Service instance

get_id()   X-Ref
Get the resource ID.

return: string

get_template()   X-Ref
Get the resource template.

return: string

get_path()   X-Ref
Get the resource path.

return: string

get_type()   X-Ref
Get the resource type.

return: string

get_service()   X-Ref
Get the resource's service.

return: mixed

get_methods()   X-Ref
Get the resource methods.

return: array

get_formats()   X-Ref
Get the resource media types.

return: array

get_variables()   X-Ref
Get the resource template variables.

return: array

get_endpoint()   X-Ref
Get the resource fully qualified endpoint.

return: string

check_tool($typeid, $body = null, $scopes = null)   X-Ref
Check to make sure the request is valid.

param: int $typeid                   The typeid we want to use
param: string $body                  Body of HTTP request message
param: string[] $scopes              Array of scope(s) required for incoming request
return: boolean

check_tool_proxy($toolproxyguid, $body = null)   X-Ref
Check to make sure the request is valid.

param: string $toolproxyguid Consumer key
param: string $body          Body of HTTP request message
return: boolean

check_type($typeid, $contextid, $permissionrequested, $body = null)   X-Ref
Check to make sure the request is valid.

param: int $typeid                   The typeid we want to use
param: int $contextid                The course we are at
param: string $permissionrequested   The permission to be checked
param: string $body                  Body of HTTP request message
return: boolean

get_permissions($ltitype)   X-Ref
get permissions from the config of the tool for that resource

param: int $ltitype Type of LTI
return: array with the permissions related to this resource by the $ltitype or empty if none.

parse_value($value)   X-Ref
Parse a value for custom parameter substitution variables.

param: string $value String to be parsed
return: string

parse_template()   X-Ref
Parse the template for variables.

return: array