Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

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

   1  <?php
   2  
   3  namespace Box\Spout\Writer\Common\Entity;
   4  
   5  /**
   6   * Class Workbook
   7   * Entity describing a workbook
   8   */
   9  class Workbook
  10  {
  11      /** @var Worksheet[] List of the workbook's sheets */
  12      private $worksheets = [];
  13  
  14      /** @var string Timestamp based unique ID identifying the workbook */
  15      private $internalId;
  16  
  17      /**
  18       * Workbook constructor.
  19       */
  20      public function __construct()
  21      {
  22          $this->internalId = uniqid();
  23      }
  24  
  25      /**
  26       * @return Worksheet[]
  27       */
  28      public function getWorksheets()
  29      {
  30          return $this->worksheets;
  31      }
  32  
  33      /**
  34       * @param Worksheet[] $worksheets
  35       */
  36      public function setWorksheets($worksheets)
  37      {
  38          $this->worksheets = $worksheets;
  39      }
  40  
  41      /**
  42       * @return string
  43       */
  44      public function getInternalId()
  45      {
  46          return $this->internalId;
  47      }
  48  }