Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 401] [Versions 400 and 402] [Versions 400 and 403]

   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              LtiServiceConnector::METHOD_GET,
  18              $this->getServiceData()['context_memberships_url']
  19          );
  20          $request->setAccept(static::CONTENTTYPE_MEMBERSHIPCONTAINER);
  21  
  22          return $this->getAll($request, 'members');
  23      }
  24  }