Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [Versions 400 and 403] [Versions 401 and 403]

   1  <?php
   2  
   3  namespace IMSGlobal\LTI\Profile;
   4  
   5  /**
   6   * Class to represent an LTI service object
   7   *
   8   * @author  Stephen P Vickers <svickers@imsglobal.org>
   9   * @copyright  IMS Global Learning Consortium Inc
  10   * @date  2016
  11   * @version 3.0.0
  12   * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
  13   */
  14  
  15  #[\AllowDynamicProperties]
  16  class ServiceDefinition
  17  {
  18  
  19  /**
  20   * Media types supported by service.
  21   *
  22   * @var array $formats
  23   */
  24      public $formats = null;
  25  /**
  26   * HTTP actions accepted by service.
  27   *
  28   * @var array $actions
  29   */
  30      public $actions = null;
  31  /**
  32   * ID of service.
  33   *
  34   * @var string $id
  35   */
  36      public $id = null;
  37  /**
  38   * URL for service requests.
  39   *
  40   * @var string $endpoint
  41   */
  42      public $endpoint = null;
  43  
  44  /**
  45   * Class constructor.
  46   *
  47   * @param array  $formats   Array of media types supported by service
  48   * @param array  $actions   Array of HTTP actions accepted by service
  49   * @param string $id        ID of service (optional)
  50   * @param string $endpoint  URL for service requests (optional)
  51   */
  52  
  53      function __construct($formats, $actions, $id = null, $endpoint = null)
  54      {
  55  
  56          $this->formats = $formats;
  57          $this->actions = $actions;
  58          $this->id = $id;
  59          $this->endpoint = $endpoint;
  60  
  61      }
  62  
  63      function setId($id) {
  64  
  65          $this->id = $id;
  66  
  67      }
  68  
  69  }