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

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

+ Inheritance diagram for ApiContext:

Public Member Functions

 __construct (Context $context)
 Class constructor.
 
bool isConfigured ()
 Check if the API hook has been configured.
 
bool getGroups ()
 Get course group sets and groups.
 
array bool getMemberships (bool $withGroups)
 Get Memberships.
 
array bool getToolSettings (?ToolSettingsMode $mode=null, bool $simple=true)
 Get Tool Settings.
 
bool setToolSettings (array $settings=[])
 Perform a Tool Settings service request.
 

Protected Attributes

Context $context
 Context object.
 

Detailed Description

Class to implement context services for a platform 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
Licence: http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3

Constructor & Destructor Documentation

◆ __construct()

__construct ( Context $context)

Class constructor.

Parameters
Context$context

Reimplemented in CanvasApiContext, and MoodleApiContext.

Member Function Documentation

◆ getGroups()

bool getGroups ( )

Get course group sets and groups.

Returns
bool True if the request was successful

Reimplemented in CanvasApiContext, and MoodleApiContext.

◆ getMemberships()

array bool getMemberships ( bool $withGroups)

Get Memberships.

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

Reimplemented in CanvasApiContext, and MoodleApiContext.

◆ getToolSettings()

array bool getToolSettings ( ?ToolSettingsMode $mode = null,
bool $simple = true )

Get Tool Settings.

Parameters
ToolSettingsMode | null$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
array|bool The array of settings if successful, otherwise false

◆ isConfigured()

bool isConfigured ( )

Check if the API hook has been configured.

Returns
bool True if the API hook has been configured

◆ setToolSettings()

bool setToolSettings ( array $settings = [])

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