LTI Integration Library 5.0.0-rc2
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.
 
ToolConsumer getConsumer ()
 Get tool consumer.
 
Platform getPlatform ()
 Get platform.
 
string getScope ()
 Get access scope.
 
HttpMessage send ($method, $parameters=array(), $body=null)
 Send a service request.
 
HttpMessage getHttpMessage ()
 Get HttpMessage object for last request.
 

Public Attributes

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

Protected Member Functions

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

Protected Attributes

string $endpoint = null
 Service endpoint.
 
string $scope = null
 Service access scope.
 
string $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

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.

Member Function Documentation

◆ getConsumer()

ToolConsumer getConsumer ( )

Get tool consumer.

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

◆ getHttpMessage()

HttpMessage getHttpMessage ( )

Get HttpMessage object for last request.

Returns
HttpMessage HTTP object containing request and response details

References Service\getHttpMessage().

Referenced by Service\getHttpMessage().

◆ getPlatform()

Platform getPlatform ( )

Get platform.

Returns
Platform Platform for this service

References Service\getPlatform().

Referenced by Service\getPlatform().

◆ getScope()

string getScope ( )

Get access scope.

Returns
string Access scope

References Service\getScope().

Referenced by Service\getScope().

◆ parseContextsInArray()

array parseContextsInArray (   $contexts,
  $arr 
)
protected

Parse the JSON for context references.

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

◆ send()

HttpMessage 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

Referenced by Score\submit().

Member Data Documentation

◆ $endpoint

string $endpoint = null
protected

Service endpoint.

$endpoint

Referenced by Score\__construct(), and AssignmentGrade\__construct().

◆ $mediaType

string $mediaType = null
protected

Media type of message body.

$mediaType

◆ $scope

string $scope = null
protected

Service access scope.

$scope

◆ $unsigned

bool $unsigned = false

Whether service request should be sent unsigned.

$unsigned


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