Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 402] [Versions 400 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.

return: boolean
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

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

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

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

return: boolean
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

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

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

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

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

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

return: array