LTI Integration Library 5.1.4
PHP class library for building LTI integrations
 
Loading...
Searching...
No Matches
ToolSettings Class Reference

Class to implement the Tool Settings service. More...

+ Inheritance diagram for ToolSettings:

Public Member Functions

 __construct (Platform|Context|ResourceLink $source, string $endpoint, bool $simple=true)
 Class constructor.
 
array bool get (?ToolSettingsMode $mode=null)
 Get the tool settings.
 
bool set (array $settings)
 Set the tool settings.
 
- Public Member Functions inherited from Service
 __construct (Platform $platform, ?string $endpoint)
 Class constructor.
 
Platform getPlatform ()
 Get platform.
 
string getScope ()
 Get access scope.
 
HttpMessage send (string $method, ?array $parameters=[], string $body='')
 Send a service request.
 
HttpMessage getHttpMessage ()
 Get HttpMessage object for last request.
 

Public Attributes

const MEDIA_TYPE_TOOL_SETTINGS = 'application/vnd.ims.lti.v2.toolsettings+json'
 Media type for tool settings service.
 
const MEDIA_TYPE_TOOL_SETTINGS_SIMPLE = 'application/vnd.ims.lti.v2.toolsettings.simple+json'
 Media type for tool settings simple service.
 
- Public Attributes inherited from Service
bool $unsigned = false
 Whether service request should be sent unsigned.
 

Static Public Attributes

static string $SCOPE = 'https://purl.imsglobal.org/spec/lti-ts/scope/toolsetting'
 Access scope.
 

Additional Inherited Members

- Protected Member Functions inherited from Service
array parseContextsInArray (object|array $contexts, array $arr)
 Parse the JSON for context references.
 
- Protected Attributes inherited from Service
string $endpoint = null
 Service endpoint.
 
string $scope = null
 Service access scope.
 
string $mediaType = null
 Media type of message body.
 

Detailed Description

Class to implement the Tool Settings service.

Author
Stephen P Vickers steph.nosp@m.en@s.nosp@m.pvsof.nosp@m.twar.nosp@m.eprod.nosp@m.ucts.nosp@m..com
Licence: http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3

Constructor & Destructor Documentation

◆ __construct()

__construct ( Platform|Context|ResourceLink $source,
string $endpoint,
bool $simple = true )

Class constructor.

Parameters
Platform | Context | ResourceLink$sourceThe object to which the settings apply (ResourceLink, Context or Platform)
string$endpointService endpoint
bool$simpleTrue if the simple media type is to be used (optional, default is true)

Member Function Documentation

◆ get()

array bool get ( ?ToolSettingsMode $mode = null)

Get the tool settings.

Parameters
ToolSettingsMode | null$modeMode for request (optional, default is current level only)
Returns
array|bool The array of settings if successful, otherwise false

◆ set()

bool set ( array $settings)

Set the tool settings.

Parameters
array$settingsAn associative array of settings (optional, default is null)
Returns
bool True if request was successful

References Util\$strictMode, Util\setMessage(), and Util\valToString().