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

Class to implement the Membership service. More...

+ Inheritance diagram for Membership:

Public Member Functions

 __construct (ResourceLink|Context $source, string $endpoint, string $format=self::MEDIA_TYPE_MEMBERSHIPS_V1, ?int $limit=null, bool $pagingMode=false)
 Class constructor.
 
array bool get (?string $role=null, ?int $limit=null)
 Get the memberships.
 
array bool getWithGroups (?string $role=null, ?int $limit=null)
 Get the memberships.
 
- Public Member Functions inherited from Service
 __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

const MEDIA_TYPE_MEMBERSHIPS_V1 = 'application/vnd.ims.lis.v2.membershipcontainer+json'
 Media type for version 1 of Memberships service.
 
const MEDIA_TYPE_MEMBERSHIPS_NRPS = 'application/vnd.ims.lti-nrps.v2.membershipcontainer+json'
 Media type for Names and Role Provisioning service.
 
- Public Attributes inherited from Service
bool $unsigned = false
 Whether service request should be sent unsigned.
 

Static Public Attributes

static string $SCOPE = 'https://purl.imsglobal.org/spec/lti-nrps/scope/contextmembership.readonly'
 Access scope.
 
static int $defaultLimit = 100
 Default limit on size of container to be returned from requests.
 

Additional Inherited Members

- Protected Member Functions inherited from Service
array parseContextsInArray (object|array $contexts, array $arr)
 Parse the JSON for context references.
 
- Protected Attributes inherited from Service
string $endpoint = null
 Service endpoint.
 
string $scope = null
 Service access scope.
 
string $mediaType = null
 Media type of message body.
 

Detailed Description

Class to implement the Membership 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 ( ResourceLink|Context $source,
string $endpoint,
string $format = self::MEDIA_TYPE_MEMBERSHIPS_V1,
?int $limit = null,
bool $pagingMode = false )

Class constructor.

Parameters
object$sourceThe object to which the memberships apply (ResourceLink or Context)
string$endpointService endpoint
string$formatFormat to request
int | null$limitLimit of line-items to be returned in each request, null for all
bool$pagingModeTrue if only a single page should be requested when a limit is set

Member Function Documentation

◆ get()

array bool get ( ?string $role = null,
?int $limit = null )

Get the memberships.

Parameters
string | null$roleRole for which memberships are to be requested (optional, default is all roles)
int | null$limitLimit on the number of memberships to be returned in each request, null for service default (optional)
Returns
array|bool The array of UserResult objects if successful, otherwise false

◆ getWithGroups()

array bool getWithGroups ( ?string $role = null,
?int $limit = null )

Get the memberships.

Parameters
string | null$roleRole for which memberships are to be requested (optional, default is all roles)
int | null$limitLimit on the number of memberships to be returned in each request, null for service default (optional)
Returns
array|bool The array of UserResult objects if successful, otherwise false