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

Class to implement context services for a tool consumer via its proprietary API. More...

Inheritance diagram for ApiContext:
CanvasApiContext MoodleApiContext

Public Member Functions

 __construct ($context)
 Class constructor. More...
 
 getMemberships ($withGroups)
 Get Memberships. More...
 
 getToolSettings ($mode=Service\ToolSettings::MODE_CURRENT_LEVEL, $simple=true)
 Get Tool Settings. More...
 
 setToolSettings ($settings=array())
 Perform a Tool Settings service request. More...
 

Protected Attributes

 $context = null
 Context object. More...
 

Detailed Description

Class to implement context services for a tool consumer via its proprietary API.

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 13 of file ApiContext.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $context)

Class constructor.

Parameters
\ceLTIc\LTI\Context$context

Definition at line 28 of file ApiContext.php.

References ApiContext\$context.

Member Function Documentation

◆ getMemberships()

getMemberships (   $withGroups)

Get Memberships.

Parameters
bool$withGroupsTrue is group information is to be requested as well
Returns
mixed The array of UserResult objects if successful, otherwise false

Definition at line 40 of file ApiContext.php.

◆ getToolSettings()

getToolSettings (   $mode = Service\ToolSettings::MODE_CURRENT_LEVEL,
  $simple = true 
)

Get Tool Settings.

Parameters
int$modeMode for request (optional, default is current level only)
bool$simpleTrue if all the simple media type is to be used (optional, default is true)
Returns
mixed The array of settings if successful, otherwise false

Definition at line 53 of file ApiContext.php.

◆ setToolSettings()

setToolSettings (   $settings = array())

Perform a Tool Settings service request.

Parameters
array$settingsAn associative array of settings (optional, default is none)
Returns
bool True if action was successful, otherwise false

Definition at line 65 of file ApiContext.php.

Field Documentation

◆ $context

ceLTIc LTI Context null $context = null
protected

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