LTI Integration Library 5.3.0
PHP class library for building LTI integrations
Loading...
Searching...
No Matches

Class to implement a service. More...

Inheritance diagram for 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()

__construct ( Platform $platform,
?string $endpoint )

Class constructor.

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

Member Function Documentation

◆ getHttpMessage()

HttpMessage getHttpMessage ( )

Get HttpMessage object for last request.

Returns
HttpMessage HTTP object containing request and response details

◆ getPlatform()

Platform getPlatform ( )

Get platform.

Returns
Platform Platform for this service

◆ getScope()

string getScope ( )

Get access scope.

Returns
string Access scope

◆ parseContextsInArray()

array 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 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 LineItem\__construct(), LineItem\createLineItem(), and Membership\getWithGroups().