Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 400 and 401]

   1  <?php
   2  
   3  namespace Packback\Lti1p3;
   4  
   5  class LtiNamesRolesProvisioningService extends LtiAbstractService
   6  {
   7      public const CONTENTTYPE_MEMBERSHIPCONTAINER = 'application/vnd.ims.lti-nrps.v2.membershipcontainer+json';
   8  
   9      public function getScope(): array
  10      {
  11          return [LtiConstants::NRPS_SCOPE_MEMBERSHIP_READONLY];
  12      }
  13  
  14      public function getMembers(): array
  15      {
  16          $request = new ServiceRequest(
  17              ServiceRequest::METHOD_GET,
  18              $this->getServiceData()['context_memberships_url'],
  19              ServiceRequest::TYPE_GET_MEMBERSHIPS
  20          );
  21          $request->setAccept(static::CONTENTTYPE_MEMBERSHIPCONTAINER);
  22  
  23          return $this->getAll($request, 'members');
  24      }
  25  }