LTI Integration Library  3.1.0
PHP class library for building LTI integrations
ToolSettings Class Reference

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

Inheritance diagram for ToolSettings:
Service

Public Member Functions

 __construct ($source, $endpoint, $simple=true)
 Class constructor. More...
 
 get ($mode=self::MODE_CURRENT_LEVEL)
 Get the tool settings. More...
 
 set ($settings)
 Set the tool settings. More...
 
- Public Member Functions inherited from Service
 __construct ($consumer, $endpoint, $mediaType)
 Class constructor. More...
 
 send ($method, $parameters=array(), $body=null)
 Send a service request. More...
 
 getHTTPMessage ()
 Get HTTPMessage object for last request. More...
 

Data Fields

const MODE_CURRENT_LEVEL = 1
 Settings at current level mode. More...
 
const MODE_ALL_LEVELS = 2
 Settings at all levels mode. More...
 
const MODE_DISTINCT_NAMES = 3
 Settings with distinct names at all levels mode. More...
 
- Data Fields inherited from Service
 $unsigned = false
 Whether service request should be sent unsigned. More...
 

Additional Inherited Members

- Protected Attributes inherited from Service
 $endpoint
 Service endpoint. More...
 

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
Version
3.1.0
Licence: http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3

Definition at line 17 of file ToolSettings.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $source,
  $endpoint,
  $simple = true 
)

Class constructor.

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

Definition at line 65 of file ToolSettings.php.

References Service\$endpoint.

Member Function Documentation

◆ get()

get (   $mode = self::MODE_CURRENT_LEVEL)

Get the tool settings.

Parameters
int$modeMode for request (optional, default is current level only)
Returns
mixed The array of settings if successful, otherwise false

Definition at line 89 of file ToolSettings.php.

References Service\send().

◆ set()

set (   $settings)

Set the tool settings.

Parameters
array$settingsAn associative array of settings (optional, default is null)
Returns
HTTPMessage HTTP object containing request and response details

Definition at line 121 of file ToolSettings.php.

Field Documentation

◆ MODE_ALL_LEVELS

const MODE_ALL_LEVELS = 2

Settings at all levels mode.

Definition at line 28 of file ToolSettings.php.

◆ MODE_CURRENT_LEVEL

const MODE_CURRENT_LEVEL = 1

Settings at current level mode.

Definition at line 23 of file ToolSettings.php.

◆ MODE_DISTINCT_NAMES

const MODE_DISTINCT_NAMES = 3

Settings with distinct names at all levels mode.

Definition at line 33 of file ToolSettings.php.


The documentation for this class was generated from the following file: