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

Class to implement a service. More...

Inheritance diagram for Service:
AssessmentControl AssignmentGrade Groups Membership ToolSettings LineItem Result Score

Public Member Functions

 __construct ($platform, $endpoint)
 Class constructor.
 
 getConsumer ()
 Get tool consumer.
 
 getPlatform ()
 Get platform.
 
 getScope ()
 Get access scope.
 
 send ($method, $parameters=array(), $body=null)
 Send a service request.
 
 getHttpMessage ()
 Get HttpMessage object for last request.
 

Data Fields

 $unsigned = false
 Whether service request should be sent unsigned.
 

Protected Member Functions

 parseContextsInArray ($contexts, $arr)
 Parse the JSON for context references.
 

Protected Attributes

 $endpoint = null
 Service endpoint.
 
 $scope = null
 Service access scope.
 
 $mediaType = null
 Media type of message body.
 

Detailed Description

Class to implement a 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

Definition at line 18 of file Service.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $platform,
  $endpoint 
)

Class constructor.

Parameters
Platform$platformPlatform object for this service request
string$endpointService endpoint

Reimplemented in Score, and AssessmentControl.

Definition at line 69 of file Service.php.

References Service\$endpoint.

Member Function Documentation

◆ getConsumer()

getConsumer ( )

Get tool consumer.

Deprecated:
Use getPlatform() instead
See also
Service::getPlatform()
Returns
ToolConsumer Consumer for this service

Definition at line 83 of file Service.php.

References Service\getPlatform(), and Util\logDebug().

◆ getHttpMessage()

getHttpMessage ( )

Get HttpMessage object for last request.

Returns
HttpMessage HTTP object containing request and response details

Definition at line 193 of file Service.php.

◆ getPlatform()

getPlatform ( )

Get platform.

Returns
Platform Platform for this service

Definition at line 95 of file Service.php.

Referenced by Service\getConsumer().

◆ getScope()

getScope ( )

Get access scope.

Returns
string Access scope

Definition at line 105 of file Service.php.

◆ parseContextsInArray()

parseContextsInArray (   $contexts,
  $arr 
)
protected

Parse the JSON for context references.

Parameters
object$contextsJSON contexts
array$arrArray to be parsed
Returns
array Parsed array

Definition at line 210 of file Service.php.

◆ send()

send (   $method,
  $parameters = array(),
  $body = null 
)

Send a service request.

Parameters
string$methodThe action type constant (optional, default is GET)
array$parametersQuery parameters to add to endpoint (optional, default is none)
string$bodyBody of request (optional, default is null)
Returns
HttpMessage HTTP object containing request and response details

Definition at line 119 of file Service.php.

References Util\jsonDecode().

Referenced by LineItem\createLineItem(), LineItem\deleteLineItem(), ToolSettings\get(), Result\get(), Result\getAll(), LineItem\getAll(), Groups\getGroups(), Groups\getGroupSets(), LineItem\saveLineItem(), Score\submit(), and AssessmentControl\submitAction().

Field Documentation

◆ $endpoint

◆ $mediaType

string $mediaType = null
protected

Media type of message body.

Definition at line 47 of file Service.php.

◆ $scope

string $scope = null
protected

Service access scope.

Definition at line 40 of file Service.php.

◆ $unsigned

bool $unsigned = false

Whether service request should be sent unsigned.

Definition at line 26 of file Service.php.


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