LTI Integration Library 4.10.3
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:
Service

Public Member Functions

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

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.
 
- Data Fields inherited from Service
 $unsigned = false
 Whether service request should be sent unsigned.
 

Static Public Attributes

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

Additional Inherited Members

- Protected Member Functions inherited from Service
 parseContextsInArray ($contexts, $arr)
 Parse the JSON for context references.
 
- Protected Attributes inherited from Service
 $endpoint = null
 Service endpoint.
 
 $scope = null
 Service access scope.
 
 $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

Definition at line 16 of file Membership.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $source,
  $endpoint,
  $format = self::MEDIA_TYPE_MEMBERSHIPS_V1,
  $limit = null,
  $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

Definition at line 73 of file Membership.php.

References Service\$endpoint, and Membership\$SCOPE.

Member Function Documentation

◆ get()

get (   $role = null,
  $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

Definition at line 92 of file Membership.php.

◆ getWithGroups()

getWithGroups (   $role = null,
  $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

Definition at line 105 of file Membership.php.

Field Documentation

◆ $defaultLimit

$defaultLimit = 100
static

Default limit on size of container to be returned from requests.

Definition at line 37 of file Membership.php.

◆ $SCOPE

$SCOPE = 'https://purl.imsglobal.org/spec/lti-nrps/scope/contextmembership.readonly'
static

Access scope.

Definition at line 32 of file Membership.php.

Referenced by Membership\__construct().

◆ MEDIA_TYPE_MEMBERSHIPS_NRPS

const MEDIA_TYPE_MEMBERSHIPS_NRPS = 'application/vnd.ims.lti-nrps.v2.membershipcontainer+json'

Media type for Names and Role Provisioning service.

Definition at line 27 of file Membership.php.

◆ MEDIA_TYPE_MEMBERSHIPS_V1

const MEDIA_TYPE_MEMBERSHIPS_V1 = 'application/vnd.ims.lis.v2.membershipcontainer+json'

Media type for version 1 of Memberships service.

Definition at line 22 of file Membership.php.


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