Class to implement a service. More...
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. | |
Class to implement a service.
Definition at line 18 of file Service.php.
__construct | ( | $platform, | |
$endpoint | |||
) |
Class constructor.
Platform | $platform | Platform object for this service request |
string | $endpoint | Service endpoint |
Reimplemented in Score, and AssessmentControl.
Definition at line 69 of file Service.php.
References Service\$endpoint.
getConsumer | ( | ) |
Get tool consumer.
Definition at line 83 of file Service.php.
References Service\getPlatform(), and Util\logDebug().
getHttpMessage | ( | ) |
Get HttpMessage object for last request.
Definition at line 193 of file Service.php.
getPlatform | ( | ) |
Get platform.
Definition at line 95 of file Service.php.
Referenced by Service\getConsumer().
getScope | ( | ) |
|
protected |
Parse the JSON for context references.
object | $contexts | JSON contexts |
array | $arr | Array to be parsed |
Definition at line 210 of file Service.php.
send | ( | $method, | |
$parameters = array() , |
|||
$body = null |
|||
) |
Send a service request.
string | $method | The action type constant (optional, default is GET) |
array | $parameters | Query parameters to add to endpoint (optional, default is none) |
string | $body | Body of request (optional, default is null) |
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().
|
protected |
Service endpoint.
Definition at line 33 of file Service.php.
Referenced by Score\__construct(), Service\__construct(), Result\__construct(), AssignmentGrade\__construct(), AssessmentControl\__construct(), Membership\__construct(), ToolSettings\__construct(), Result\getAll(), Groups\getGroups(), and Groups\getGroupSets().
|
protected |
Media type of message body.
Definition at line 47 of file Service.php.
|
protected |
Service access scope.
Definition at line 40 of file Service.php.
bool $unsigned = false |
Whether service request should be sent unsigned.
Definition at line 26 of file Service.php.