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

Class to implement a service. More...

+ Inheritance diagram for ceLTIc\LTI\Service\Service:

Public Member Functions

 __construct (Platform $platform, ?string $endpoint)
 Class constructor.
 
Platform getPlatform ()
 Get platform.
 
string getScope ()
 Get access scope.
 
HttpMessage send (string $method, ?array $parameters=[], string $body='')
 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 (object|array $contexts, array $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()

ceLTIc\LTI\Service\Service::__construct ( Platform $platform,
?string $endpoint )

Class constructor.

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

Member Function Documentation

◆ getHttpMessage()

HttpMessage ceLTIc\LTI\Service\Service::getHttpMessage ( )

Get HttpMessage object for last request.

Returns
HttpMessage HTTP object containing request and response details

◆ getPlatform()

Platform ceLTIc\LTI\Service\Service::getPlatform ( )

Get platform.

Returns
Platform Platform for this service

◆ getScope()

string ceLTIc\LTI\Service\Service::getScope ( )

Get access scope.

Returns
string Access scope

◆ parseContextsInArray()

array ceLTIc\LTI\Service\Service::parseContextsInArray ( object|array $contexts,
array $arr )
protected

Parse the JSON for context references.

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

◆ send()

HttpMessage ceLTIc\LTI\Service\Service::send ( string $method,
?array $parameters = [],
string $body = '' )

Send a service request.

Parameters
string$methodThe action type constant (optional, default is GET)
array | null$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 ceLTIc\LTI\Service\Groups\get(), and ceLTIc\LTI\Service\LineItem\saveLineItem().

Member Data Documentation

◆ $endpoint

string ceLTIc\LTI\Service\Service::$endpoint = null
protected

◆ $mediaType

string ceLTIc\LTI\Service\Service::$mediaType = null
protected

Media type of message body.

◆ $scope

string ceLTIc\LTI\Service\Service::$scope = null
protected

Service access scope.

◆ $unsigned

bool ceLTIc\LTI\Service\Service::$unsigned = false

Whether service request should be sent unsigned.